| 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 // This provides a way to access the application's current preferences. | 5 // This provides a way to access the application's current preferences. |
| 6 | 6 |
| 7 // Chromium settings and storage represent user-selected preferences and | 7 // Chromium settings and storage represent user-selected preferences and |
| 8 // information and MUST not be extracted, overwritten or modified except | 8 // information and MUST not be extracted, overwritten or modified except |
| 9 // through Chromium defined APIs. | 9 // through Chromium defined APIs. |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
| 22 #include "base/prefs/public/pref_service_base.h" | 22 #include "base/prefs/public/pref_service_base.h" |
| 23 #include "base/threading/non_thread_safe.h" | 23 #include "base/threading/non_thread_safe.h" |
| 24 | 24 |
| 25 class CommandLine; | 25 class CommandLine; |
| 26 class DefaultPrefStore; | 26 class DefaultPrefStore; |
| 27 class PersistentPrefStore; | 27 class PersistentPrefStore; |
| 28 class PrefModelAssociator; | 28 class PrefModelAssociator; |
| 29 class PrefNotifier; | 29 class PrefNotifier; |
| 30 class PrefNotifierImpl; | 30 class PrefNotifierImpl; |
| 31 class PrefObserver; | |
| 32 class PrefServiceObserver; | 31 class PrefServiceObserver; |
| 33 class PrefStore; | 32 class PrefStore; |
| 34 class PrefValueStore; | 33 class PrefValueStore; |
| 35 | 34 |
| 36 namespace syncer { | 35 namespace syncer { |
| 37 class SyncableService; | 36 class SyncableService; |
| 38 } | 37 } |
| 39 | 38 |
| 40 namespace policy { | 39 namespace policy { |
| 41 class PolicyService; | 40 class PolicyService; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // vs. std::map, and by roughly 180ms vs. std::set of Preference pointers. | 299 // vs. std::map, and by roughly 180ms vs. std::set of Preference pointers. |
| 301 typedef base::hash_map<std::string, Preference> PreferenceMap; | 300 typedef base::hash_map<std::string, Preference> PreferenceMap; |
| 302 | 301 |
| 303 friend class PrefServiceMockBuilder; | 302 friend class PrefServiceMockBuilder; |
| 304 | 303 |
| 305 // Give access to ReportUserPrefChanged() and GetMutableUserPref(). | 304 // Give access to ReportUserPrefChanged() and GetMutableUserPref(). |
| 306 friend class subtle::ScopedUserPrefUpdateBase; | 305 friend class subtle::ScopedUserPrefUpdateBase; |
| 307 | 306 |
| 308 // PrefServiceBase implementation (protected in base, private here). | 307 // PrefServiceBase implementation (protected in base, private here). |
| 309 virtual void AddPrefObserver(const char* path, | 308 virtual void AddPrefObserver(const char* path, |
| 310 PrefObserver* obs) OVERRIDE; | 309 const base::Closure& obs) OVERRIDE; |
| 311 virtual void RemovePrefObserver(const char* path, | 310 virtual void RemovePrefObserver(const char* path, |
| 312 PrefObserver* obs) OVERRIDE; | 311 const base::Closure& obs) OVERRIDE; |
| 313 | 312 |
| 314 // Sends notification of a changed preference. This needs to be called by | 313 // Sends notification of a changed preference. This needs to be called by |
| 315 // a ScopedUserPrefUpdate if a DictionaryValue or ListValue is changed. | 314 // a ScopedUserPrefUpdate if a DictionaryValue or ListValue is changed. |
| 316 void ReportUserPrefChanged(const std::string& key); | 315 void ReportUserPrefChanged(const std::string& key); |
| 317 | 316 |
| 318 // Registers a new preference at |path|. The |default_value| must not be | 317 // Registers a new preference at |path|. The |default_value| must not be |
| 319 // NULL as it determines the preference value's type. | 318 // NULL as it determines the preference value's type. |
| 320 // RegisterPreference must not be called twice for the same path. | 319 // RegisterPreference must not be called twice for the same path. |
| 321 // This method takes ownership of |default_value|. | 320 // This method takes ownership of |default_value|. |
| 322 void RegisterPreference(const char* path, | 321 void RegisterPreference(const char* path, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // CreatePrefServiceWithPerTabPrefStore() have been called to create a | 360 // CreatePrefServiceWithPerTabPrefStore() have been called to create a |
| 362 // "forked" PrefService. | 361 // "forked" PrefService. |
| 363 bool pref_service_forked_; | 362 bool pref_service_forked_; |
| 364 | 363 |
| 365 ObserverList<PrefServiceObserver> observer_list_; | 364 ObserverList<PrefServiceObserver> observer_list_; |
| 366 | 365 |
| 367 DISALLOW_COPY_AND_ASSIGN(PrefService); | 366 DISALLOW_COPY_AND_ASSIGN(PrefService); |
| 368 }; | 367 }; |
| 369 | 368 |
| 370 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ | 369 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ |
| OLD | NEW |