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

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: another rebase 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..9cd504eac85a3b1fcd16820249e9b3f738205b7c 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -1413,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 =
@@ -1422,6 +1423,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
@@ -1494,6 +1505,10 @@ void ProfileSyncService::ConfigureDataTypeManager() {
}
#endif
+ const syncer::ModelTypeSet priority_types = GetPriorityDataTypes();
+ data_type_manager_->Configure(priority_types,
Nicolas Zea 2013/02/21 23:41:11 hmm, I'm not sure this is the right place to do th
albertb 2013/02/22 20:08:47 Done.
+ syncer::CONFIGURE_REASON_RECONFIGURATION);
+
const syncer::ModelTypeSet types = GetPreferredDataTypes();
if (IsPassphraseRequiredForDecryption()) {
// We need a passphrase still. We don't bother to attempt to configure

Powered by Google App Engine
This is Rietveld 408576698