Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 RegisterDependentTypes(); | |
|
akalin
2012/03/01 07:40:59
I guess this'll be RegisterPrefGroups
not at google - send to devlin
2012/03/01 23:39:36
Done.
| |
| 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 |
| 129 // Returns a ModelTypeSet based on |types| augmented with any dependent types | |
|
akalin
2012/03/01 07:40:59
augmented with any dependent types ... ->
expanded
not at google - send to devlin
2012/03/01 23:39:36
Done.
| |
| 130 // (see |dependent_types_|), but as a subset of |registered_types|. | |
| 131 syncable::ModelTypeSet ResolveDependentTypes( | |
| 132 const syncable::ModelTypeSet& registered_types, | |
| 133 const syncable::ModelTypeSet& types) const; | |
| 134 | |
| 128 base::NonThreadSafe non_thread_safe_; | 135 base::NonThreadSafe non_thread_safe_; |
| 129 | 136 |
| 130 // May be NULL. | 137 // May be NULL. |
| 131 PrefService* const pref_service_; | 138 PrefService* const pref_service_; |
| 132 | 139 |
| 133 ObserverList<SyncPrefObserver> sync_pref_observers_; | 140 ObserverList<SyncPrefObserver> sync_pref_observers_; |
| 134 | 141 |
| 135 // The preference that controls whether sync is under control by | 142 // The preference that controls whether sync is under control by |
| 136 // configuration management. | 143 // configuration management. |
| 137 BooleanPrefMember pref_sync_managed_; | 144 BooleanPrefMember pref_sync_managed_; |
| 138 | 145 |
| 146 // Data types where the enable/disabled preference is dependent on another | |
| 147 // type, such APP_NOTIFICATIONS on APPS. This is map from dependent type | |
| 148 // (APP_NOTIFICATIONS) -> type depended on (APPS). | |
| 149 typedef std::map<syncable::ModelType, syncable::ModelType> | |
| 150 DependentTypesMap; | |
| 151 DependentTypesMap dependent_types_; | |
| 152 | |
| 139 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); | 153 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); |
| 140 }; | 154 }; |
| 141 | 155 |
| 142 } // namespace browser_sync | 156 } // namespace browser_sync |
| 143 | 157 |
| 144 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_ | 158 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_ |
| OLD | NEW |