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_PREFS_PREF_VALUE_STORE_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_VALUE_STORE_H_ |
6 #define CHROME_BROWSER_PREFS_PREF_VALUE_STORE_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_VALUE_STORE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 // Gets the value for the given preference name that has the specified value | 65 // Gets the value for the given preference name that has the specified value |
66 // type. Values stored in a PrefStore that have the matching |name| but | 66 // type. Values stored in a PrefStore that have the matching |name| but |
67 // a non-matching |type| are silently skipped. Returns true if a valid value | 67 // a non-matching |type| are silently skipped. Returns true if a valid value |
68 // was found in any of the available PrefStores. Most callers should use | 68 // was found in any of the available PrefStores. Most callers should use |
69 // Preference::GetValue() instead of calling this method directly. | 69 // Preference::GetValue() instead of calling this method directly. |
70 bool GetValue(const std::string& name, | 70 bool GetValue(const std::string& name, |
71 base::Value::Type type, | 71 base::Value::Type type, |
72 const Value** out_value) const; | 72 const Value** out_value) const; |
73 | 73 |
| 74 // Gets the recommended value for the given preference name that has the |
| 75 // specified value type. A value stored in the recommended PrefStore that has |
| 76 // the matching |name| but a non-matching |type| is silently skipped. Returns |
| 77 // true if a valid value was found in the recommended PrefStore. Most callers |
| 78 // should use Preference::GetRecommendedValue() instead of calling this method |
| 79 // directly. |
| 80 bool GetRecommendedValue(const std::string& name, |
| 81 base::Value::Type type, |
| 82 const Value** out_value) const; |
| 83 |
74 // These methods return true if a preference with the given name is in the | 84 // These methods return true if a preference with the given name is in the |
75 // indicated pref store, even if that value is currently being overridden by | 85 // indicated pref store, even if that value is currently being overridden by |
76 // a higher-priority source. | 86 // a higher-priority source. |
77 bool PrefValueInManagedStore(const char* name) const; | 87 bool PrefValueInManagedStore(const char* name) const; |
78 bool PrefValueInExtensionStore(const char* name) const; | 88 bool PrefValueInExtensionStore(const char* name) const; |
79 bool PrefValueInUserStore(const char* name) const; | 89 bool PrefValueInUserStore(const char* name) const; |
80 | 90 |
81 // These methods return true if a preference with the given name is actually | 91 // These methods return true if a preference with the given name is actually |
82 // being controlled by the indicated pref store and not being overridden by | 92 // being controlled by the indicated pref store and not being overridden by |
83 // a higher-priority source. | 93 // a higher-priority source. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // A mapping of preference names to their registered types. | 242 // A mapping of preference names to their registered types. |
233 PrefTypeMap pref_types_; | 243 PrefTypeMap pref_types_; |
234 | 244 |
235 // True if not all of the PrefStores were initialized successfully. | 245 // True if not all of the PrefStores were initialized successfully. |
236 bool initialization_failed_; | 246 bool initialization_failed_; |
237 | 247 |
238 DISALLOW_COPY_AND_ASSIGN(PrefValueStore); | 248 DISALLOW_COPY_AND_ASSIGN(PrefValueStore); |
239 }; | 249 }; |
240 | 250 |
241 #endif // CHROME_BROWSER_PREFS_PREF_VALUE_STORE_H_ | 251 #endif // CHROME_BROWSER_PREFS_PREF_VALUE_STORE_H_ |
OLD | NEW |