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 | 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 Loading... |
47 class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), | 47 class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), |
48 public base::SupportsWeakPtr<SyncPrefs> { | 48 public base::SupportsWeakPtr<SyncPrefs> { |
49 public: | 49 public: |
50 // |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 |
51 // setter methods should be called. Does not take ownership of | 51 // setter methods should be called. Does not take ownership of |
52 // |pref_service|. | 52 // |pref_service|. |
53 explicit SyncPrefs(PrefService* pref_service); | 53 explicit SyncPrefs(PrefService* pref_service); |
54 | 54 |
55 virtual ~SyncPrefs(); | 55 virtual ~SyncPrefs(); |
56 | 56 |
57 static void RegisterUserPrefs(PrefService* prefs, | 57 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
58 PrefRegistrySyncable* registry); | |
59 | 58 |
60 // Checks if sync is enabled for the profile that owns |io_data|. This must | 59 // Checks if sync is enabled for the profile that owns |io_data|. This must |
61 // be invoked on the IO thread, and can be used to check if sync is enabled | 60 // be invoked on the IO thread, and can be used to check if sync is enabled |
62 // on that thread. | 61 // on that thread. |
63 static bool IsSyncAccessibleOnIOThread(ProfileIOData* io_data); | 62 static bool IsSyncAccessibleOnIOThread(ProfileIOData* io_data); |
64 | 63 |
65 void AddSyncPrefObserver(SyncPrefObserver* sync_pref_observer); | 64 void AddSyncPrefObserver(SyncPrefObserver* sync_pref_observer); |
66 void RemoveSyncPrefObserver(SyncPrefObserver* sync_pref_observer); | 65 void RemoveSyncPrefObserver(SyncPrefObserver* sync_pref_observer); |
67 | 66 |
68 // Clears important sync preferences. | 67 // Clears important sync preferences. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // etc. | 162 // etc. |
164 typedef std::map<syncer::ModelType, syncer::ModelTypeSet> PrefGroupsMap; | 163 typedef std::map<syncer::ModelType, syncer::ModelTypeSet> PrefGroupsMap; |
165 PrefGroupsMap pref_groups_; | 164 PrefGroupsMap pref_groups_; |
166 | 165 |
167 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); | 166 DISALLOW_COPY_AND_ASSIGN(SyncPrefs); |
168 }; | 167 }; |
169 | 168 |
170 } // namespace browser_sync | 169 } // namespace browser_sync |
171 | 170 |
172 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_ | 171 #endif // CHROME_BROWSER_SYNC_SYNC_PREFS_H_ |
OLD | NEW |