| 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_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Returns true if an extension identified by |extension_id| controls the | 109 // Returns true if an extension identified by |extension_id| controls the |
| 110 // preference. This means this extension has set a preference value and no | 110 // preference. This means this extension has set a preference value and no |
| 111 // other extension with higher precedence overrides it. | 111 // other extension with higher precedence overrides it. |
| 112 // Note that the this function does does not consider the existence of | 112 // Note that the this function does does not consider the existence of |
| 113 // policies. An extension is only really able to control a preference if | 113 // policies. An extension is only really able to control a preference if |
| 114 // PrefService::Preference::IsExtensionModifiable() returns true as well. | 114 // PrefService::Preference::IsExtensionModifiable() returns true as well. |
| 115 bool DoesExtensionControlPref(const std::string& extension_id, | 115 bool DoesExtensionControlPref(const std::string& extension_id, |
| 116 const std::string& pref_key, | 116 const std::string& pref_key, |
| 117 bool incognito) const; | 117 bool incognito) const; |
| 118 | 118 |
| 119 // Returns true if an extension identified by |extension_id| controls the |
| 120 // preference, *and* it is specific to incognito mode. This means this |
| 121 // extension has set a preference value and no other extension with higher |
| 122 // precedence overrides it. |
| 123 // Note that the this function does does not consider the existence of |
| 124 // policies. An extension is only really able to control a preference if |
| 125 // PrefService::Preference::IsExtensionModifiable() returns true as well. |
| 126 bool DoesExtensionControlIncognitoPref(const std::string& extension_id, |
| 127 const std::string& pref_key) const; |
| 128 |
| 119 // Tell the store it's now fully initialized. | 129 // Tell the store it's now fully initialized. |
| 120 void NotifyInitializationCompleted(); | 130 void NotifyInitializationCompleted(); |
| 121 | 131 |
| 122 // Registers the time when an extension |ext_id| is installed. | 132 // Registers the time when an extension |ext_id| is installed. |
| 123 void RegisterExtension(const std::string& ext_id, | 133 void RegisterExtension(const std::string& ext_id, |
| 124 const base::Time& install_time, | 134 const base::Time& install_time, |
| 125 bool is_enabled); | 135 bool is_enabled); |
| 126 | 136 |
| 127 // Deletes all entries related to extension |ext_id|. | 137 // Deletes all entries related to extension |ext_id|. |
| 128 void UnregisterExtension(const std::string& ext_id); | 138 void UnregisterExtension(const std::string& ext_id); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // being destroyed. In tests, it isn't called, so the notification must | 191 // being destroyed. In tests, it isn't called, so the notification must |
| 182 // be done in the destructor. This bit tracks whether it has been done yet. | 192 // be done in the destructor. This bit tracks whether it has been done yet. |
| 183 bool destroyed_; | 193 bool destroyed_; |
| 184 | 194 |
| 185 ObserverList<Observer, true> observers_; | 195 ObserverList<Observer, true> observers_; |
| 186 | 196 |
| 187 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); | 197 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); |
| 188 }; | 198 }; |
| 189 | 199 |
| 190 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ | 200 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ |
| OLD | NEW |