| 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_PREFS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 bool extensions_disabled, | 143 bool extensions_disabled, |
| 144 scoped_ptr<TimeProvider> time_provider); | 144 scoped_ptr<TimeProvider> time_provider); |
| 145 | 145 |
| 146 virtual ~ExtensionPrefs(); | 146 virtual ~ExtensionPrefs(); |
| 147 | 147 |
| 148 // Returns all installed extensions from extension preferences provided by | 148 // Returns all installed extensions from extension preferences provided by |
| 149 // |pref_service|. This is exposed for ProtectedPrefsWatcher because it needs | 149 // |pref_service|. This is exposed for ProtectedPrefsWatcher because it needs |
| 150 // access to the extension ID list before the ExtensionService is initialized. | 150 // access to the extension ID list before the ExtensionService is initialized. |
| 151 static ExtensionIdList GetExtensionsFrom(const PrefService* pref_service); | 151 static ExtensionIdList GetExtensionsFrom(const PrefService* pref_service); |
| 152 | 152 |
| 153 // Returns a copy of the Extensions prefs. | |
| 154 // TODO(erikkay) Remove this so that external consumers don't need to be | |
| 155 // aware of the internal structure of the preferences. | |
| 156 base::DictionaryValue* CopyCurrentExtensions(); | |
| 157 | |
| 158 // Returns true if the specified external extension was uninstalled by the | 153 // Returns true if the specified external extension was uninstalled by the |
| 159 // user. | 154 // user. |
| 160 bool IsExternalExtensionUninstalled(const std::string& id) const; | 155 bool IsExternalExtensionUninstalled(const std::string& id) const; |
| 161 | 156 |
| 162 // Checks whether |extension_id| is disabled. If there's no state pref for | 157 // Checks whether |extension_id| is disabled. If there's no state pref for |
| 163 // the extension, this will return false. Generally you should use | 158 // the extension, this will return false. Generally you should use |
| 164 // ExtensionService::IsExtensionEnabled instead. | 159 // ExtensionService::IsExtensionEnabled instead. |
| 165 bool IsExtensionDisabled(const std::string& id) const; | 160 bool IsExtensionDisabled(const std::string& id) const; |
| 166 | 161 |
| 167 // Get/Set the order that the browser actions appear in the toolbar. | 162 // Get/Set the order that the browser actions appear in the toolbar. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 202 |
| 208 virtual bool ReadPrefAsList(const std::string& extension_id, | 203 virtual bool ReadPrefAsList(const std::string& extension_id, |
| 209 const std::string& pref_key, | 204 const std::string& pref_key, |
| 210 const base::ListValue** out_value) const OVERRIDE; | 205 const base::ListValue** out_value) const OVERRIDE; |
| 211 | 206 |
| 212 virtual bool ReadPrefAsDictionary( | 207 virtual bool ReadPrefAsDictionary( |
| 213 const std::string& extension_id, | 208 const std::string& extension_id, |
| 214 const std::string& pref_key, | 209 const std::string& pref_key, |
| 215 const base::DictionaryValue** out_value) const OVERRIDE; | 210 const base::DictionaryValue** out_value) const OVERRIDE; |
| 216 | 211 |
| 217 // Getter and setter for browser action visibility. | |
| 218 bool GetBrowserActionVisibility(const Extension* extension); | |
| 219 void SetBrowserActionVisibility(const Extension* extension, | |
| 220 bool visible); | |
| 221 | |
| 222 // Did the extension ask to escalate its permission during an upgrade? | 212 // Did the extension ask to escalate its permission during an upgrade? |
| 223 bool DidExtensionEscalatePermissions(const std::string& id); | 213 bool DidExtensionEscalatePermissions(const std::string& id); |
| 224 | 214 |
| 225 // If |did_escalate| is true, the preferences for |extension| will be set to | 215 // If |did_escalate| is true, the preferences for |extension| will be set to |
| 226 // require the install warning when the user tries to enable. | 216 // require the install warning when the user tries to enable. |
| 227 void SetDidExtensionEscalatePermissions( | 217 void SetDidExtensionEscalatePermissions( |
| 228 const Extension* extension, | 218 const Extension* extension, |
| 229 bool did_escalate); | 219 bool did_escalate); |
| 230 | 220 |
| 231 // Getter and setters for disabled reason. | 221 // Getter and setters for disabled reason. |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 scoped_refptr<ContentSettingsStore> content_settings_store_; | 678 scoped_refptr<ContentSettingsStore> content_settings_store_; |
| 689 | 679 |
| 690 scoped_ptr<TimeProvider> time_provider_; | 680 scoped_ptr<TimeProvider> time_provider_; |
| 691 | 681 |
| 692 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 682 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
| 693 }; | 683 }; |
| 694 | 684 |
| 695 } // namespace extensions | 685 } // namespace extensions |
| 696 | 686 |
| 697 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 687 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| OLD | NEW |