-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
228 additions
and
273 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
4 changes: 3 additions & 1 deletion
4
chromium_src/chrome/browser/bookmarks/bookmark_model_factory.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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#include "chrome/browser/bookmarks/chrome_bookmark_client.h" | ||
#include "brave/browser/bookmarks/brave_bookmark_client.h" | ||
#define ChromeBookmarkClient BraveBookmarkClient | ||
// Stop loading old Brave permanent nodes, GetEntityForBookmarkNode will fail | ||
// see 9645795920481e2a80613a72aeddba1a65490dac | ||
// #define ChromeBookmarkClient BraveBookmarkClient | ||
#include "../../../../../../chrome/browser/bookmarks/bookmark_model_factory.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
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
8 changes: 4 additions & 4 deletions
8
...ync/driver/glue/sync_backend_host_impl.cc → ...ents/sync/driver/glue/sync_engine_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
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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc | ||
index 8c36199a7b7514d1ac5e710a938287a167da91a5..50e07746517364f85c93ee6feae38eea16de7892 100644 | ||
index 3efbe8f776e1ecfd212fee726fad5c360d9788c6..ce8f6e05186781e40a0224125ed248a6fa102dc9 100644 | ||
--- a/chrome/browser/sync/chrome_sync_client.cc | ||
+++ b/chrome/browser/sync/chrome_sync_client.cc | ||
@@ -159,7 +159,8 @@ syncer::ModelTypeSet GetDisabledTypesFromCommandLine() { | ||
@@ -164,7 +164,8 @@ syncer::ModelTypeSet GetDisabledTypesFromCommandLine() { | ||
|
||
} // namespace | ||
|
||
-ChromeSyncClient::ChromeSyncClient(Profile* profile) : profile_(profile) {} | ||
-ChromeSyncClient::ChromeSyncClient(Profile* profile) : profile_(profile) { | ||
+ChromeSyncClient::ChromeSyncClient(Profile* profile) : profile_(profile), | ||
+ brave_sync_client_(brave_sync::BraveSyncClient::Create(profile)) {} | ||
+ brave_sync_client_(brave_sync::BraveSyncClient::Create(profile)) { | ||
DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
|
||
ChromeSyncClient::~ChromeSyncClient() { | ||
} | ||
profile_web_data_service_ = |
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
63 changes: 12 additions & 51 deletions
63
patches/components-browser_sync-profile_sync_service.cc.patch
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 |
---|---|---|
@@ -1,84 +1,45 @@ | ||
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc | ||
index a0355393caba17c8343ec2a771eeb29d731d27e4..08a9666b1ac5fcd6c6ab737b2874afc331e02a69 100644 | ||
index 787e2d24941cbaa469373ed5baad14d1ac9f3722..8f5a0b7a2d4e263992822375621ed624027913fd 100644 | ||
--- a/components/browser_sync/profile_sync_service.cc | ||
+++ b/components/browser_sync/profile_sync_service.cc | ||
@@ -198,6 +198,8 @@ ProfileSyncService::ProfileSyncService(InitParams init_params) | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
@@ -184,6 +184,8 @@ ProfileSyncService::ProfileSyncService(InitParams init_params) | ||
DCHECK(sync_client_); | ||
DCHECK(IsLocalSyncEnabled() || identity_manager_ != nullptr); | ||
|
||
+ BraveSyncSetup(); | ||
+ | ||
// If Sync is disabled via command line flag, then ProfileSyncService | ||
// shouldn't be instantiated. | ||
DCHECK(IsSyncAllowedByFlag()); | ||
@@ -539,7 +541,10 @@ void ProfileSyncService::StartUpSlowEngineComponents() { | ||
->GetLocalDeviceInfoProvider() | ||
DCHECK(switches::IsSyncAllowedByFlag()); | ||
@@ -480,6 +482,8 @@ void ProfileSyncService::StartUpSlowEngineComponents() { | ||
->GetSyncUserAgent(); | ||
params.http_factory_getter = MakeHttpPostProviderFactoryGetter(); | ||
- params.credentials = auth_manager_->GetCredentials(); | ||
+ if (IsBraveSyncEnabled()) | ||
+ params.credentials = GetDummyCredentials(); | ||
+ else | ||
+ params.credentials = auth_manager_->GetCredentials(); | ||
params.credentials = auth_manager_->GetCredentials(); | ||
+ if (IsBraveSyncEnabled()) | ||
+ BraveEngineParamsInit(¶ms); | ||
DCHECK(!params.credentials.account_id.empty() || IsLocalSyncEnabled()); | ||
if (!base::FeatureList::IsEnabled(switches::kSyncE2ELatencyMeasurement)) { | ||
invalidation::InvalidationService* invalidator = | ||
@@ -571,13 +576,14 @@ void ProfileSyncService::StartUpSlowEngineComponents() { | ||
params.short_poll_interval = sync_prefs_.GetShortPollInterval(); | ||
if (params.short_poll_interval.is_zero()) { | ||
params.short_poll_interval = | ||
- base::TimeDelta::FromSeconds(syncer::kDefaultShortPollIntervalSeconds); | ||
+ base::TimeDelta::FromSeconds(syncer::kBraveDefaultShortPollIntervalSeconds); | ||
} | ||
params.long_poll_interval = sync_prefs_.GetLongPollInterval(); | ||
if (params.long_poll_interval.is_zero()) { | ||
params.long_poll_interval = | ||
- base::TimeDelta::FromSeconds(syncer::kDefaultLongPollIntervalSeconds); | ||
+ base::TimeDelta::FromSeconds(syncer::kBraveDefaultLongPollIntervalSeconds); | ||
} | ||
+ BraveEngineParamsInit(¶ms); | ||
|
||
engine_->Initialize(std::move(params)); | ||
|
||
@@ -721,6 +727,7 @@ int ProfileSyncService::GetDisableReasons() const { | ||
DCHECK(IsSyncAllowedByFlag()); | ||
@@ -663,6 +667,7 @@ int ProfileSyncService::GetDisableReasons() const { | ||
DCHECK(switches::IsSyncAllowedByFlag()); | ||
|
||
int result = DISABLE_REASON_NONE; | ||
+ if (IsBraveSyncEnabled()) return result; | ||
if (!user_settings_->IsSyncAllowedByPlatform()) { | ||
result = result | DISABLE_REASON_PLATFORM_OVERRIDE; | ||
} | ||
@@ -1465,7 +1472,7 @@ void ProfileSyncService::ConfigureDataTypeManager( | ||
// Note: When local Sync is enabled, then we want full-sync mode (not just | ||
// transport), even though Sync-the-feature is not considered enabled. | ||
bool use_transport_only_mode = | ||
- !IsSyncFeatureEnabled() && !IsLocalSyncEnabled(); | ||
+ !IsSyncFeatureEnabled() && !IsLocalSyncEnabled() && !IsBraveSyncEnabled(); | ||
|
||
syncer::ModelTypeSet types = GetPreferredDataTypes(); | ||
// In transport-only mode, only a subset of data types is supported. | ||
@@ -1860,6 +1867,7 @@ void ProfileSyncService::GetAllNodes( | ||
|
||
syncer::ModelTypeSet all_types = GetActiveDataTypes(); | ||
all_types.PutAll(syncer::ControlTypes()); | ||
+ | ||
scoped_refptr<GetAllNodesRequestHelper> helper = | ||
new GetAllNodesRequestHelper(all_types, callback); | ||
|
||
@@ -1891,12 +1899,14 @@ void ProfileSyncService::GetAllNodes( | ||
@@ -1753,12 +1758,12 @@ void ProfileSyncService::GetAllNodes( | ||
|
||
AccountInfo ProfileSyncService::GetAuthenticatedAccountInfo() const { | ||
CoreAccountInfo ProfileSyncService::GetAuthenticatedAccountInfo() const { | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
- return auth_manager_->GetActiveAccountInfo().account_info; | ||
+ return GetDummyAccountInfo(); | ||
+ // return auth_manager_->GetActiveAccountInfo().account_info; | ||
} | ||
|
||
bool ProfileSyncService::IsAuthenticatedAccountPrimary() const { | ||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
- return auth_manager_->GetActiveAccountInfo().is_primary; | ||
+ return true; | ||
+ // return auth_manager_->GetActiveAccountInfo().is_primary; | ||
} | ||
|
||
void ProfileSyncService::SetInvalidationsForSessionsEnabled(bool enabled) { |
Oops, something went wrong.