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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 // FindPreference returns whether RegisterXXX has been invoked, where as | 210 // FindPreference returns whether RegisterXXX has been invoked, where as |
211 // this checks if a value exists for the path. | 211 // this checks if a value exists for the path. |
212 bool HasPrefPath(const char* path) const; | 212 bool HasPrefPath(const char* path) const; |
213 | 213 |
214 class PreferencePathComparator { | 214 class PreferencePathComparator { |
215 public: | 215 public: |
216 bool operator() (Preference* lhs, Preference* rhs) const { | 216 bool operator() (Preference* lhs, Preference* rhs) const { |
217 return lhs->name() < rhs->name(); | 217 return lhs->name() < rhs->name(); |
218 } | 218 } |
219 }; | 219 }; |
220 typedef std::set<Preference*, PreferencePathComparator> PreferenceSet; | 220 typedef std::set<Preference*, PreferencePathComparator> PreferenceSet; |
Mattias Nissler (ping if slow)
2011/01/26 17:55:11
Do these declarations still have to be public then
battre
2011/01/27 09:53:27
Done.
| |
221 const PreferenceSet& preference_set() const { return prefs_; } | 221 |
222 // Stores the effective preference values in |out|. | |
223 void GetPreferenceValues(DictionaryValue* out) const; | |
222 | 224 |
223 // A helper method to quickly look up a preference. Returns NULL if the | 225 // A helper method to quickly look up a preference. Returns NULL if the |
224 // preference is not registered. | 226 // preference is not registered. |
225 const Preference* FindPreference(const char* pref_name) const; | 227 const Preference* FindPreference(const char* pref_name) const; |
226 | 228 |
227 bool ReadOnly() const; | 229 bool ReadOnly() const; |
228 | 230 |
229 // TODO(mnissler): This should not be public. Change client code to call a | 231 // TODO(mnissler): This should not be public. Change client code to call a |
230 // preference setter or use ScopedPrefUpdate. | 232 // preference setter or use ScopedPrefUpdate. |
231 PrefNotifier* pref_notifier() const; | 233 PrefNotifier* pref_notifier() const; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 | 295 |
294 // Local cache of registered Preference objects. The default_store_ | 296 // Local cache of registered Preference objects. The default_store_ |
295 // is authoritative with respect to what the types and default values | 297 // is authoritative with respect to what the types and default values |
296 // of registered preferences are. | 298 // of registered preferences are. |
297 mutable PreferenceSet prefs_; | 299 mutable PreferenceSet prefs_; |
298 | 300 |
299 DISALLOW_COPY_AND_ASSIGN(PrefService); | 301 DISALLOW_COPY_AND_ASSIGN(PrefService); |
300 }; | 302 }; |
301 | 303 |
302 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ | 304 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_H_ |
OLD | NEW |