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

Unified Diff: chrome/browser/sync/sync_prefs.h

Issue 9500005: Add a declarative way in c/b/s/sync_prefs.cc to say which data types have prefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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
« no previous file with comments | « no previous file | chrome/browser/sync/sync_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_prefs.h
diff --git a/chrome/browser/sync/sync_prefs.h b/chrome/browser/sync/sync_prefs.h
index bb67b1c3812c26210a06d427d25519a84bcbf862..a599d15689b27c6f94853e933b9bd3255156caa3 100644
--- a/chrome/browser/sync/sync_prefs.h
+++ b/chrome/browser/sync/sync_prefs.h
@@ -118,6 +118,7 @@ class SyncPrefs : public base::SupportsWeakPtr<SyncPrefs>,
syncable::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const;
private:
+ void RegisterPrefGroups();
void RegisterPreferences();
void RegisterDataTypePreferredPref(
@@ -125,6 +126,12 @@ class SyncPrefs : public base::SupportsWeakPtr<SyncPrefs>,
bool GetDataTypePreferred(syncable::ModelType type) const;
void SetDataTypePreferred(syncable::ModelType type, bool is_preferred);
+ // Returns a ModelTypeSet based on |types| expanded to include pref groups
+ // (see |pref_groups_|), but as a subset of |registered_types|.
+ syncable::ModelTypeSet ResolvePrefGroups(
+ syncable::ModelTypeSet registered_types,
+ syncable::ModelTypeSet types) const;
+
base::NonThreadSafe non_thread_safe_;
// May be NULL.
@@ -136,6 +143,16 @@ class SyncPrefs : public base::SupportsWeakPtr<SyncPrefs>,
// configuration management.
BooleanPrefMember pref_sync_managed_;
+ // Groups of prefs that always have the same value as a "master" pref.
+ // For example, the APPS group has {APP_NOTIFICATIONS, APP_SETTINGS}
+ // (as well as APPS, but that is implied), so
+ // pref_groups_[syncable::APPS] = { syncable::APP_NOTIFICATIONS,
+ // syncable::APP_SETTINGS }
+ // pref_groups_[syncable::EXTENSIONS] = { syncable::EXTENSION_SETTINGS }
+ // etc.
+ typedef std::map<syncable::ModelType, syncable::ModelTypeSet> PrefGroupsMap;
+ PrefGroupsMap pref_groups_;
+
DISALLOW_COPY_AND_ASSIGN(SyncPrefs);
};
« no previous file with comments | « no previous file | chrome/browser/sync/sync_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698