diff options
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/profile_sync_components_factory_impl.cc | 8 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 11 | ||||
-rw-r--r-- | chrome/browser/sync/sync_prefs.cc | 11 |
3 files changed, 25 insertions, 5 deletions
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc index 6d17cf4..dcb9d88 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc @@ -226,12 +226,14 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( pss->RegisterDataTypeController( new PasswordDataTypeController(this, profile_, pss)); } - // Article sync is disabled by default. Register only if explicitly enabled. ExtensionService* extension_service = extension_system_->extension_service(); if (extension_service) { - OptInIntoBookmarksExperimentIfHasExtension( - extension_service->extensions()->GetIDs()); + if (IsBookmarksExtensionInstalled( + extension_service->extensions()->GetIDs())) { + OptInIntoBookmarksExperiment(); + } } + // Article sync is disabled by default. Register only if explicitly enabled. if (IsEnableSyncArticlesSet()) { pss->RegisterDataTypeController( new UIDataTypeController( diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index c6c8095..ad4b070 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -1077,6 +1077,8 @@ void ProfileSyncService::OnExperimentsChanged( if (current_experiments_.Matches(experiments)) return; + current_experiments_ = experiments; + // Handle preference-backed experiments first. if (experiments.gcm_channel_state != syncer::Experiments::UNSET) { profile()->GetPrefs()->SetBoolean(prefs::kGCMChannelEnabled, @@ -1085,6 +1087,13 @@ void ProfileSyncService::OnExperimentsChanged( gcm::GCMProfileServiceFactory::GetForProfile(profile()); } + if (experiments.enhanced_bookmarks_enabled) { + profile_->GetPrefs()->SetBoolean(prefs::kEnhancedBookmarksExperimentEnabled, + true); + profile_->GetPrefs()->SetString(prefs::kEnhancedBookmarksExtensionId, + experiments.enhanced_bookmarks_ext_id); + } + // If this is a first time sync for a client, this will be called before // OnBackendInitialized() to ensure the new datatypes are available at sync // setup. As a result, the migrator won't exist yet. This is fine because for @@ -1129,8 +1138,6 @@ void ProfileSyncService::OnExperimentsChanged( OnMigrationNeededForTypes(to_register); } } - - current_experiments_ = experiments; } void ProfileSyncService::UpdateAuthErrorState(const AuthError& error) { diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc index eabbf00..7eb1c35 100644 --- a/chrome/browser/sync/sync_prefs.cc +++ b/chrome/browser/sync/sync_prefs.cc @@ -74,6 +74,17 @@ void SyncPrefs::RegisterProfilePrefs( RegisterDataTypePreferredPref(registry, syncer::BOOKMARKS, true); user_types.Remove(syncer::BOOKMARKS); + // These two prefs are set from sync experiment to enable enhanced bookmarks. + registry->RegisterBooleanPref( + prefs::kEnhancedBookmarksExperimentEnabled, + false, + user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + + registry->RegisterStringPref( + prefs::kEnhancedBookmarksExtensionId, + std::string(), + user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); + // All types are set to off by default, which forces a configuration to // explicitly enable them. GetPreferredTypes() will ensure that any new // implicit types are enabled when their pref group is, or via |