| OLD | NEW |
| 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 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 27 matching lines...) Expand all Loading... |
| 38 // TODO(akalin): Some classes still read the prefs directly. Consider | 38 // TODO(akalin): Some classes still read the prefs directly. Consider |
| 39 // passing down a pointer to SyncPrefs to them. A list of files: | 39 // passing down a pointer to SyncPrefs to them. A list of files: |
| 40 // | 40 // |
| 41 // profile_sync_service_startup_unittest.cc | 41 // profile_sync_service_startup_unittest.cc |
| 42 // profile_sync_service.cc | 42 // profile_sync_service.cc |
| 43 // sync_setup_flow.cc | 43 // sync_setup_flow.cc |
| 44 // sync_setup_wizard.cc | 44 // sync_setup_wizard.cc |
| 45 // sync_setup_wizard_unittest.cc | 45 // sync_setup_wizard_unittest.cc |
| 46 // two_client_preferences_sync_test.cc | 46 // two_client_preferences_sync_test.cc |
| 47 class SyncPrefs : public base::SupportsWeakPtr<SyncPrefs>, | 47 class SyncPrefs : public base::SupportsWeakPtr<SyncPrefs>, |
| 48 public sync_notifier::InvalidationStateTracker, | |
| 49 public content::NotificationObserver { | 48 public content::NotificationObserver { |
| 50 public: | 49 public: |
| 51 // |pref_service| may be NULL (for unit tests), but in that case no | 50 // |pref_service| may be NULL (for unit tests), but in that case no |
| 52 // setter methods should be called. Does not take ownership of | 51 // setter methods should be called. Does not take ownership of |
| 53 // |pref_service|. | 52 // |pref_service|. |
| 54 explicit SyncPrefs(PrefService* pref_service); | 53 explicit SyncPrefs(PrefService* pref_service); |
| 55 | 54 |
| 56 virtual ~SyncPrefs(); | 55 virtual ~SyncPrefs(); |
| 57 | 56 |
| 58 void AddSyncPrefObserver(SyncPrefObserver* sync_pref_observer); | 57 void AddSyncPrefObserver(SyncPrefObserver* sync_pref_observer); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 std::string GetEncryptionBootstrapToken() const; | 98 std::string GetEncryptionBootstrapToken() const; |
| 100 void SetEncryptionBootstrapToken(const std::string& token); | 99 void SetEncryptionBootstrapToken(const std::string& token); |
| 101 | 100 |
| 102 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
| 103 // Use this spare bootstrap token only when setting up sync for the first | 102 // Use this spare bootstrap token only when setting up sync for the first |
| 104 // time. | 103 // time. |
| 105 std::string GetSpareBootstrapToken() const; | 104 std::string GetSpareBootstrapToken() const; |
| 106 void SetSpareBootstrapToken(const std::string& token); | 105 void SetSpareBootstrapToken(const std::string& token); |
| 107 #endif | 106 #endif |
| 108 | 107 |
| 109 // InvalidationStateTracker implementation. | |
| 110 virtual sync_notifier::InvalidationVersionMap | |
| 111 GetAllMaxVersions() const OVERRIDE; | |
| 112 virtual void SetMaxVersion(syncable::ModelType model_type, | |
| 113 int64 max_version) OVERRIDE; | |
| 114 | |
| 115 // Merges the given set of types with the set of acknowledged types. | 108 // Merges the given set of types with the set of acknowledged types. |
| 116 void AcknowledgeSyncedTypes(syncable::ModelTypeSet types); | 109 void AcknowledgeSyncedTypes(syncable::ModelTypeSet types); |
| 117 | 110 |
| 118 // content::NotificationObserver implementation. | 111 // content::NotificationObserver implementation. |
| 119 virtual void Observe(int type, | 112 virtual void Observe(int type, |
| 120 const content::NotificationSource& source, | 113 const content::NotificationSource& source, |
| 121 const content::NotificationDetails& details) OVERRIDE; | 114 const content::NotificationDetails& details) OVERRIDE; |
| 122 | 115 |
| 123 // For testing. | 116 // For testing. |
| 124 | 117 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // etc. | 153 // etc. |
| 161 typedef std::map<syncable::ModelType, syncable::ModelTypeSet> PrefGroupsMap; | 154 typedef std::map<syncable::ModelType, syncable::ModelTypeSet> PrefGroupsMap; |
| 162 PrefGroupsMap pref_groups_; | 155 PrefGroupsMap pref_groups_; |
| 163 | 156 |
| 164 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); | 157 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); |
| 165 }; | 158 }; |
| 166 | 159 |
| 167 } // namespace browser_sync | 160 } // namespace browser_sync |
| 168 | 161 |
| 169 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_ | 162 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_ |
| OLD | NEW |