| 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 is the base interface for a preference services that provides | 5 // This is the base interface for a preference services that provides |
| 6 // a way to access the application's current preferences. | 6 // a way to access the application's current preferences. |
| 7 // | 7 // |
| 8 // This base interface assumes all preferences are local. See | 8 // This base interface assumes all preferences are local. See |
| 9 // SyncablePrefServiceBase for the interface to a preference service | 9 // SyncablePrefServiceBase for the interface to a preference service |
| 10 // that stores preferences that can be synced. | 10 // that stores preferences that can be synced. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 // Returns true if the preference for the given preference name is available | 102 // Returns true if the preference for the given preference name is available |
| 103 // and is managed. | 103 // and is managed. |
| 104 virtual bool IsManagedPreference(const char* pref_name) const = 0; | 104 virtual bool IsManagedPreference(const char* pref_name) const = 0; |
| 105 | 105 |
| 106 // Returns |true| if a preference with the given name is available and its | 106 // Returns |true| if a preference with the given name is available and its |
| 107 // value can be changed by the user. | 107 // value can be changed by the user. |
| 108 virtual bool IsUserModifiablePreference(const char* pref_name) const = 0; | 108 virtual bool IsUserModifiablePreference(const char* pref_name) const = 0; |
| 109 | 109 |
| 110 // Unregisters a preference. | |
| 111 virtual void UnregisterPreference(const char* path) = 0; | |
| 112 | |
| 113 // Look up a preference. Returns NULL if the preference is not | 110 // Look up a preference. Returns NULL if the preference is not |
| 114 // registered. | 111 // registered. |
| 115 virtual const Preference* FindPreference(const char* pref_name) const = 0; | 112 virtual const Preference* FindPreference(const char* pref_name) const = 0; |
| 116 | 113 |
| 117 // If the path is valid and the value at the end of the path matches the type | 114 // If the path is valid and the value at the end of the path matches the type |
| 118 // specified, it will return the specified value. Otherwise, the default | 115 // specified, it will return the specified value. Otherwise, the default |
| 119 // value (set when the pref was registered) will be returned. | 116 // value (set when the pref was registered) will be returned. |
| 120 virtual bool GetBoolean(const char* path) const = 0; | 117 virtual bool GetBoolean(const char* path) const = 0; |
| 121 virtual int GetInteger(const char* path) const = 0; | 118 virtual int GetInteger(const char* path) const = 0; |
| 122 virtual double GetDouble(const char* path) const = 0; | 119 virtual double GetDouble(const char* path) const = 0; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // | 167 // |
| 171 // If the pref at the given path changes, we call the observer's | 168 // If the pref at the given path changes, we call the observer's |
| 172 // OnPreferenceChanged method. Note that observers should not call | 169 // OnPreferenceChanged method. Note that observers should not call |
| 173 // these methods directly but rather use a PrefChangeRegistrar to | 170 // these methods directly but rather use a PrefChangeRegistrar to |
| 174 // make sure the observer gets cleaned up properly. | 171 // make sure the observer gets cleaned up properly. |
| 175 virtual void AddPrefObserver(const char* path, PrefObserver* obs) = 0; | 172 virtual void AddPrefObserver(const char* path, PrefObserver* obs) = 0; |
| 176 virtual void RemovePrefObserver(const char* path, PrefObserver* obs) = 0; | 173 virtual void RemovePrefObserver(const char* path, PrefObserver* obs) = 0; |
| 177 }; | 174 }; |
| 178 | 175 |
| 179 #endif // BASE_PREFS_PUBLIC_PREF_SERVICE_BASE_H_ | 176 #endif // BASE_PREFS_PUBLIC_PREF_SERVICE_BASE_H_ |
| OLD | NEW |