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

Side by Side Diff: components/sync_driver/sync_prefs.h

Issue 266233002: Add BackupRollbackController for starting backup/rollback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « components/sync_driver/pref_names.cc ('k') | components/sync_driver/sync_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_
6 #define COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ 6 #define COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // sync_setup_wizard.cc 47 // sync_setup_wizard.cc
48 // sync_setup_wizard_unittest.cc 48 // sync_setup_wizard_unittest.cc
49 // two_client_preferences_sync_test.cc 49 // two_client_preferences_sync_test.cc
50 class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), 50 class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe),
51 public base::SupportsWeakPtr<SyncPrefs> { 51 public base::SupportsWeakPtr<SyncPrefs> {
52 public: 52 public:
53 // |pref_service| may not be NULL. 53 // |pref_service| may not be NULL.
54 // Does not take ownership of |pref_service|. 54 // Does not take ownership of |pref_service|.
55 explicit SyncPrefs(PrefService* pref_service); 55 explicit SyncPrefs(PrefService* pref_service);
56 56
57 // For testing.
58 SyncPrefs();
59
57 virtual ~SyncPrefs(); 60 virtual ~SyncPrefs();
58 61
59 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 62 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
60 63
61 void AddSyncPrefObserver(SyncPrefObserver* sync_pref_observer); 64 void AddSyncPrefObserver(SyncPrefObserver* sync_pref_observer);
62 void RemoveSyncPrefObserver(SyncPrefObserver* sync_pref_observer); 65 void RemoveSyncPrefObserver(SyncPrefObserver* sync_pref_observer);
63 66
64 // Clears important sync preferences. 67 // Clears important sync preferences.
65 void ClearPreferences(); 68 void ClearPreferences();
66 69
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 #if defined(OS_CHROMEOS) 120 #if defined(OS_CHROMEOS)
118 // Use this spare bootstrap token only when setting up sync for the first 121 // Use this spare bootstrap token only when setting up sync for the first
119 // time. 122 // time.
120 std::string GetSpareBootstrapToken() const; 123 std::string GetSpareBootstrapToken() const;
121 void SetSpareBootstrapToken(const std::string& token); 124 void SetSpareBootstrapToken(const std::string& token);
122 #endif 125 #endif
123 126
124 // Merges the given set of types with the set of acknowledged types. 127 // Merges the given set of types with the set of acknowledged types.
125 void AcknowledgeSyncedTypes(syncer::ModelTypeSet types); 128 void AcknowledgeSyncedTypes(syncer::ModelTypeSet types);
126 129
130 // Get/Set number of rollback attempts allowed.
131 virtual int GetRemainingRollbackTries() const;
132 virtual void SetRemainingRollbackTries(int times);
133
127 // For testing. 134 // For testing.
128 135
129 void SetManagedForTest(bool is_managed); 136 void SetManagedForTest(bool is_managed);
130 syncer::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const; 137 syncer::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const;
131 138
132 private: 139 private:
133 void RegisterPrefGroups(); 140 void RegisterPrefGroups();
134 141
135 static void RegisterDataTypePreferredPref( 142 static void RegisterDataTypePreferredPref(
136 user_prefs::PrefRegistrySyncable* prefs, 143 user_prefs::PrefRegistrySyncable* prefs,
(...skipping 27 matching lines...) Expand all
164 // etc. 171 // etc.
165 typedef std::map<syncer::ModelType, syncer::ModelTypeSet> PrefGroupsMap; 172 typedef std::map<syncer::ModelType, syncer::ModelTypeSet> PrefGroupsMap;
166 PrefGroupsMap pref_groups_; 173 PrefGroupsMap pref_groups_;
167 174
168 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); 175 DISALLOW_COPY_AND_ASSIGN(SyncPrefs);
169 }; 176 };
170 177
171 } // namespace browser_sync 178 } // namespace browser_sync
172 179
173 #endif // COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_ 180 #endif // COMPONENTS_SYNC_DRIVER_SYNC_PREFS_H_
OLDNEW
« no previous file with comments | « components/sync_driver/pref_names.cc ('k') | components/sync_driver/sync_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698