-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable History datatype for Sync (#20329)
* Reverted PR#16705 (Sync all history) * Reverted PR#16478 (Display history sync diagnostic info) * Reverted PR#20071 (Disable history sync datatype to fallback to typed urls datatype) * Added overrides for HistoryModelTypeController and HistoryDeleteDirectivesModelTypeController to work when encrypt everything option is on * Add patch to sync history delete directives and history entities together * Added unit test for LowPriorityUserTypes * Enable encryption of history sync entities * Added test for precondition state of history datatype controllers * Modified: clean out HistoryDeleteDirectiveSpecifics::UrlDirective::url field, as it is unencrypted * Added test to ensure we don't send url at HistoryDeleteDirectiveSpecifics::UrlDirective * Modified ModelTypeTest.EncryptableUserTypes test to check History type * Removed 'path_excludes' for the files removed in the current PR --------- Co-authored-by: Darnell Andries <[email protected]>
- Loading branch information
Showing
36 changed files
with
380 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include_rules = [ | ||
"+brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h", | ||
"+brave/components/history/core/browser/sync/brave_history_model_type_controller.h", | ||
] |
17 changes: 17 additions & 0 deletions
17
chromium_src/components/browser_sync/sync_api_component_factory_impl.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/components/history/core/browser/sync/brave_history_delete_directives_model_type_controller.h" | ||
#include "brave/components/history/core/browser/sync/brave_history_model_type_controller.h" | ||
|
||
#define HistoryDeleteDirectivesModelTypeController \ | ||
BraveHistoryDeleteDirectivesModelTypeController | ||
|
||
#define HistoryModelTypeController BraveHistoryModelTypeController | ||
|
||
#include "src/components/browser_sync/sync_api_component_factory_impl.cc" | ||
|
||
#undef HistoryModelTypeController | ||
#undef HistoryDeleteDirectivesModelTypeController |
89 changes: 0 additions & 89 deletions
89
chromium_src/components/history/core/browser/history_backend.cc
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
chromium_src/components/history/core/browser/history_backend.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include_rules = [ | ||
"+src/components/history/core/browser/sync/delete_directive_handler_unittest.cc", | ||
] |
83 changes: 0 additions & 83 deletions
83
chromium_src/components/history/core/browser/sync/brave_typed_url_sync_bridge_unittest.cc
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
chromium_src/components/history/core/browser/sync/chromium_typed_url_sync_bridge_unittest.cc
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
chromium_src/components/history/core/browser/sync/delete_directive_handler.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "components/history/core/browser/sync/delete_directive_handler.h" | ||
|
||
#define CreateUrlDeleteDirective CreateUrlDeleteDirective_ChromiumImpl | ||
#include "src/components/history/core/browser/sync/delete_directive_handler.cc" | ||
#undef CreateUrlDeleteDirective | ||
|
||
namespace history { | ||
|
||
bool DeleteDirectiveHandler::CreateUrlDeleteDirective(const GURL& url) { | ||
return false; | ||
} | ||
|
||
} // namespace history |
17 changes: 17 additions & 0 deletions
17
chromium_src/components/history/core/browser/sync/delete_directive_handler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_ | ||
#define BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_ | ||
|
||
#define CreateTimeRangeDeleteDirective \ | ||
CreateUrlDeleteDirective_ChromiumImpl(const GURL& url); \ | ||
bool CreateTimeRangeDeleteDirective | ||
|
||
#include "src/components/history/core/browser/sync/delete_directive_handler.h" // IWYU pragma: export | ||
|
||
#undef CreateTimeRangeDeleteDirective | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_ |
17 changes: 17 additions & 0 deletions
17
chromium_src/components/history/core/browser/sync/delete_directive_handler_unittest.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "src/components/history/core/browser/sync/delete_directive_handler_unittest.cc" | ||
|
||
namespace history { | ||
namespace { | ||
|
||
TEST_F(HistoryDeleteDirectiveHandlerTest, | ||
BraveCreateUrlDeleteDirectiveReturnsFalse) { | ||
EXPECT_FALSE(handler()->CreateUrlDeleteDirective(GURL("https://brave.com"))); | ||
} | ||
|
||
} // namespace | ||
} // namespace history |
50 changes: 0 additions & 50 deletions
50
chromium_src/components/history/core/browser/sync/typed_url_sync_bridge.cc
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.