| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_PREF_SERVICE_H_ | 7 #ifndef CHROME_BROWSER_PREF_SERVICE_H_ |
| 8 #define CHROME_BROWSER_PREF_SERVICE_H_ | 8 #define CHROME_BROWSER_PREF_SERVICE_H_ |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // preference values. | 101 // preference values. |
| 102 explicit PrefService(PrefValueStore* pref_value_store); | 102 explicit PrefService(PrefValueStore* pref_value_store); |
| 103 | 103 |
| 104 ~PrefService(); | 104 ~PrefService(); |
| 105 | 105 |
| 106 // Reloads the data from file. This should only be called when the importer | 106 // Reloads the data from file. This should only be called when the importer |
| 107 // is running during first run, and the main process may not change pref | 107 // is running during first run, and the main process may not change pref |
| 108 // values while the importer process is running. Returns true on success. | 108 // values while the importer process is running. Returns true on success. |
| 109 bool ReloadPersistentPrefs(); | 109 bool ReloadPersistentPrefs(); |
| 110 | 110 |
| 111 // Returns true if the preference for the given preference name is available |
| 112 // and is managed. |
| 113 bool IsManagedPreference(const wchar_t* pref_name) const; |
| 114 |
| 111 // Writes the data to disk. The return value only reflects whether | 115 // Writes the data to disk. The return value only reflects whether |
| 112 // serialization was successful; we don't know whether the data actually made | 116 // serialization was successful; we don't know whether the data actually made |
| 113 // it on disk (since it's on a different thread). This should only be used if | 117 // it on disk (since it's on a different thread). This should only be used if |
| 114 // we need to save immediately (basically, during shutdown). Otherwise, you | 118 // we need to save immediately (basically, during shutdown). Otherwise, you |
| 115 // should use ScheduleSavePersistentPrefs. | 119 // should use ScheduleSavePersistentPrefs. |
| 116 bool SavePersistentPrefs(); | 120 bool SavePersistentPrefs(); |
| 117 | 121 |
| 118 // Serializes the data and schedules save using ImportantFileWriter. | 122 // Serializes the data and schedules save using ImportantFileWriter. |
| 119 void ScheduleSavePersistentPrefs(); | 123 void ScheduleSavePersistentPrefs(); |
| 120 | 124 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 typedef base::hash_map<std::wstring, NotificationObserverList*> | 260 typedef base::hash_map<std::wstring, NotificationObserverList*> |
| 257 PrefObserverMap; | 261 PrefObserverMap; |
| 258 PrefObserverMap pref_observers_; | 262 PrefObserverMap pref_observers_; |
| 259 | 263 |
| 260 friend class ScopedPrefUpdate; | 264 friend class ScopedPrefUpdate; |
| 261 | 265 |
| 262 DISALLOW_COPY_AND_ASSIGN(PrefService); | 266 DISALLOW_COPY_AND_ASSIGN(PrefService); |
| 263 }; | 267 }; |
| 264 | 268 |
| 265 #endif // CHROME_BROWSER_PREF_SERVICE_H_ | 269 #endif // CHROME_BROWSER_PREF_SERVICE_H_ |
| OLD | NEW |