| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // PrefService::Preference::IsExtensionModifiable() returns true as well. | 101 // PrefService::Preference::IsExtensionModifiable() returns true as well. |
| 102 bool CanExtensionControlPref(const std::string& extension_id, | 102 bool CanExtensionControlPref(const std::string& extension_id, |
| 103 const std::string& pref_key, | 103 const std::string& pref_key, |
| 104 bool incognito) const; | 104 bool incognito) const; |
| 105 | 105 |
| 106 // Removes all "incognito session only" preference values. | 106 // Removes all "incognito session only" preference values. |
| 107 void ClearAllIncognitoSessionOnlyPreferences(); | 107 void ClearAllIncognitoSessionOnlyPreferences(); |
| 108 | 108 |
| 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. If |from_incognito| |
| 112 // is not NULL, looks at incognito preferences first, and |from_incognito| is |
| 113 // set to true if the effective pref value is coming from the incognito |
| 114 // preferences, false if it is coming from the normal ones. |
| 112 // Note that the this function does does not consider the existence of | 115 // 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 | 116 // policies. An extension is only really able to control a preference if |
| 114 // PrefService::Preference::IsExtensionModifiable() returns true as well. | 117 // PrefService::Preference::IsExtensionModifiable() returns true as well. |
| 115 bool DoesExtensionControlPref(const std::string& extension_id, | 118 bool DoesExtensionControlPref(const std::string& extension_id, |
| 116 const std::string& pref_key, | 119 const std::string& pref_key, |
| 117 bool incognito) const; | 120 bool* from_incognito) const; |
| 118 | 121 |
| 119 // Tell the store it's now fully initialized. | 122 // Tell the store it's now fully initialized. |
| 120 void NotifyInitializationCompleted(); | 123 void NotifyInitializationCompleted(); |
| 121 | 124 |
| 122 // Registers the time when an extension |ext_id| is installed. | 125 // Registers the time when an extension |ext_id| is installed. |
| 123 void RegisterExtension(const std::string& ext_id, | 126 void RegisterExtension(const std::string& ext_id, |
| 124 const base::Time& install_time, | 127 const base::Time& install_time, |
| 125 bool is_enabled); | 128 bool is_enabled); |
| 126 | 129 |
| 127 // Deletes all entries related to extension |ext_id|. | 130 // Deletes all entries related to extension |ext_id|. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // being destroyed. In tests, it isn't called, so the notification must | 184 // 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. | 185 // be done in the destructor. This bit tracks whether it has been done yet. |
| 183 bool destroyed_; | 186 bool destroyed_; |
| 184 | 187 |
| 185 ObserverList<Observer, true> observers_; | 188 ObserverList<Observer, true> observers_; |
| 186 | 189 |
| 187 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); | 190 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); |
| 188 }; | 191 }; |
| 189 | 192 |
| 190 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ | 193 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ |
| OLD | NEW |