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

Side by Side 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: . Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync/sync_prefs.cc » ('j') | chrome/browser/sync/sync_prefs.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SYNC_SYNC_PREFS_H_ 5 #ifndef CHROME_BROWSER_SYNC_SYNC_PREFS_H_
6 #define CHROME_BROWSER_SYNC_SYNC_PREFS_H_ 6 #define CHROME_BROWSER_SYNC_SYNC_PREFS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 virtual void Observe(int type, 111 virtual void Observe(int type,
112 const content::NotificationSource& source, 112 const content::NotificationSource& source,
113 const content::NotificationDetails& details) OVERRIDE; 113 const content::NotificationDetails& details) OVERRIDE;
114 114
115 // For testing. 115 // For testing.
116 116
117 void SetManagedForTest(bool is_managed); 117 void SetManagedForTest(bool is_managed);
118 syncable::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const; 118 syncable::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const;
119 119
120 private: 120 private:
121 void RegisterDeterminedTypes();
121 void RegisterPreferences(); 122 void RegisterPreferences();
122 123
123 void RegisterDataTypePreferredPref( 124 void RegisterDataTypePreferredPref(
124 syncable::ModelType type, bool is_preferred); 125 syncable::ModelType type, bool is_preferred);
125 bool GetDataTypePreferred(syncable::ModelType type) const; 126 bool GetDataTypePreferred(syncable::ModelType type) const;
126 void SetDataTypePreferred(syncable::ModelType type, bool is_preferred); 127 void SetDataTypePreferred(syncable::ModelType type, bool is_preferred);
127 128
128 base::NonThreadSafe non_thread_safe_; 129 base::NonThreadSafe non_thread_safe_;
129 130
130 // May be NULL. 131 // May be NULL.
131 PrefService* const pref_service_; 132 PrefService* const pref_service_;
132 133
133 ObserverList<SyncPrefObserver> sync_pref_observers_; 134 ObserverList<SyncPrefObserver> sync_pref_observers_;
134 135
135 // The preference that controls whether sync is under control by 136 // The preference that controls whether sync is under control by
136 // configuration management. 137 // configuration management.
137 BooleanPrefMember pref_sync_managed_; 138 BooleanPrefMember pref_sync_managed_;
138 139
140 // Data types where the enable/disabled preference is determined by another
141 // type, such APP_NOTIFICATIONS being determined by APPS. This is map from
142 // determined type (APP_NOTIFICATIONS) -> determining type (APPS).
143 typedef std::map<syncable::ModelType, syncable::ModelType>
144 TypesDeterminedByMap;
akalin 2012/02/29 05:33:03 These names are kinda awkward. How about: typede
not at google - send to devlin 2012/03/01 03:14:40 I avoided using the term "dependency" because it g
145 TypesDeterminedByMap types_determined_by_;
146
139 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); 147 DISALLOW_COPY_AND_ASSIGN(SyncPrefs);
140 }; 148 };
141 149
142 } // namespace browser_sync 150 } // namespace browser_sync
143 151
144 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_ 152 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/sync_prefs.cc » ('j') | chrome/browser/sync/sync_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698