OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PREFS_PREF_SERVICE_H_ | 7 #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_H_ |
8 #define CHROME_BROWSER_PREFS_PREF_SERVICE_H_ | 8 #define CHROME_BROWSER_PREFS_PREF_SERVICE_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Writes the data to disk. The return value only reflects whether | 141 // Writes the data to disk. The return value only reflects whether |
142 // serialization was successful; we don't know whether the data actually made | 142 // serialization was successful; we don't know whether the data actually made |
143 // it on disk (since it's on a different thread). This should only be used if | 143 // it on disk (since it's on a different thread). This should only be used if |
144 // we need to save immediately (basically, during shutdown). Otherwise, you | 144 // we need to save immediately (basically, during shutdown). Otherwise, you |
145 // should use ScheduleSavePersistentPrefs. | 145 // should use ScheduleSavePersistentPrefs. |
146 bool SavePersistentPrefs(); | 146 bool SavePersistentPrefs(); |
147 | 147 |
148 // Serializes the data and schedules save using ImportantFileWriter. | 148 // Serializes the data and schedules save using ImportantFileWriter. |
149 void ScheduleSavePersistentPrefs(); | 149 void ScheduleSavePersistentPrefs(); |
150 | 150 |
| 151 // Lands pending writes to disk. |
| 152 void CommitPendingWrite(); |
| 153 |
151 // Make the PrefService aware of a pref. | 154 // Make the PrefService aware of a pref. |
152 void RegisterBooleanPref(const char* path, bool default_value); | 155 void RegisterBooleanPref(const char* path, bool default_value); |
153 void RegisterIntegerPref(const char* path, int default_value); | 156 void RegisterIntegerPref(const char* path, int default_value); |
154 void RegisterDoublePref(const char* path, double default_value); | 157 void RegisterDoublePref(const char* path, double default_value); |
155 void RegisterStringPref(const char* path, const std::string& default_value); | 158 void RegisterStringPref(const char* path, const std::string& default_value); |
156 void RegisterFilePathPref(const char* path, const FilePath& default_value); | 159 void RegisterFilePathPref(const char* path, const FilePath& default_value); |
157 void RegisterListPref(const char* path); | 160 void RegisterListPref(const char* path); |
158 void RegisterDictionaryPref(const char* path); | 161 void RegisterDictionaryPref(const char* path); |
159 // These take ownership of the default_value: | 162 // These take ownership of the default_value: |
160 void RegisterListPref(const char* path, ListValue* default_value); | 163 void RegisterListPref(const char* path, ListValue* default_value); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 320 |
318 // Local cache of registered Preference objects. The default_store_ | 321 // Local cache of registered Preference objects. The default_store_ |
319 // is authoritative with respect to what the types and default values | 322 // is authoritative with respect to what the types and default values |
320 // of registered preferences are. | 323 // of registered preferences are. |
321 mutable PreferenceSet prefs_; | 324 mutable PreferenceSet prefs_; |
322 | 325 |
323 DISALLOW_COPY_AND_ASSIGN(PrefService); | 326 DISALLOW_COPY_AND_ASSIGN(PrefService); |
324 }; | 327 }; |
325 | 328 |
326 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ | 329 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ |
OLD | NEW |