Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 12033093: sync: Implementation of Priority Preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Attempting to parametrize the PSS pref test fixture to also test priority prefs. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 5c17fb0f3e3c01b4bd833b558a4d80e13bc5a721..02bcfbace03d406a3779950b834f4e288a2ee76d 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -824,6 +824,7 @@ void ProfileSyncService::OnBackendInitialized(
if (HasSyncSetupCompleted()) {
ConfigureDataTypeManager();
+ ConfigurePriorityDataTypes();
Nicolas Zea 2013/03/05 01:15:44 this should be before the normal types
albertb 2013/03/15 21:08:45 Done.
} else {
DCHECK(FirstSetupInProgress());
}
@@ -1268,6 +1269,7 @@ void ProfileSyncService::SetSetupInProgress(bool setup_in_progress) {
setup_in_progress_ = setup_in_progress;
if (!setup_in_progress && was_in_progress) {
if (sync_initialized()) {
+ ConfigurePriorityDataTypes();
ReconfigureDatatypeManager();
}
}
@@ -1411,6 +1413,7 @@ void ProfileSyncService::ChangePreferredDataTypes(
ReconfigureDatatypeManager();
}
+// TODO(albertb): Extract a common method.
syncer::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const {
const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes();
const syncer::ModelTypeSet preferred_types =
@@ -1457,6 +1460,13 @@ SyncBackendHost* ProfileSyncService::GetBackendForTest() {
return backend_.get();
}
+void ProfileSyncService::ConfigurePriorityDataTypes() {
+ const syncer::ModelTypeSet priority_types =
+ Intersection(GetPreferredDataTypes(), syncer::PriorityUserTypes());
+ data_type_manager_->Configure(priority_types,
+ syncer::CONFIGURE_REASON_RECONFIGURATION);
+}
+
void ProfileSyncService::ConfigureDataTypeManager() {
// Don't configure datatypes if the setup UI is still on the screen - this
// is to help multi-screen setting UIs (like iOS) where they don't want to

Powered by Google App Engine
This is Rietveld 408576698