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

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: 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 ee4690a69a8e1d87538731466a373a80507be997..3c26b2f02e7939428be4b6fc8f1d28180fa6729d 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -825,6 +825,9 @@ void ProfileSyncService::OnBackendInitialized(
}
if (HasSyncSetupCompleted()) {
+ const syncer::ModelTypeSet priority_types = GetPriorityDataTypes();
Nicolas Zea 2013/02/25 23:47:47 how about just intersecting the preferred datatype
albertb 2013/03/01 22:01:56 Done.
+ data_type_manager_->Configure(priority_types,
+ syncer::CONFIGURE_REASON_RECONFIGURATION);
ConfigureDataTypeManager();
} else {
DCHECK(FirstSetupInProgress());
@@ -1413,6 +1416,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 =
@@ -1422,6 +1426,16 @@ syncer::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const {
return Difference(preferred_types, failed_types);
}
+syncer::ModelTypeSet ProfileSyncService::GetPriorityDataTypes() const {
+ const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes();
+ const syncer::ModelTypeSet preferred_types =
+ sync_prefs_.GetPreferredDataTypes(registered_types);
+ const syncer::ModelTypeSet failed_types =
+ failed_datatypes_handler_.GetFailedTypes();
+ return Difference(Intersection(preferred_types, syncer::PriorityUserTypes()),
+ failed_types);
+}
+
syncer::ModelTypeSet ProfileSyncService::GetRegisteredDataTypes() const {
syncer::ModelTypeSet registered_types;
// The data_type_controllers_ are determined by command-line flags; that's

Powered by Google App Engine
This is Rietveld 408576698