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