summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_prefs.h
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-22 23:25:14 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-22 23:25:14 +0000
commite4f7cec0a45a803faf00875a070090b165ff1fc5 (patch)
tree8bb8f3de686997489873fb10ef5271a35b525aae /chrome/browser/extensions/extension_prefs.h
parent9b12d69bcd1f0697a637778a687c1d2d2d029149 (diff)
downloadchromium_src-e4f7cec0a45a803faf00875a070090b165ff1fc5.zip
chromium_src-e4f7cec0a45a803faf00875a070090b165ff1fc5.tar.gz
chromium_src-e4f7cec0a45a803faf00875a070090b165ff1fc5.tar.bz2
Permission escalation when extension updates should trigger the install warning when enabling the extension through the Extensions Management UI.
BUG=30752 TEST=This requires an extension that autoupdates _and_ increases its permissions. If you ignore the infobar that says it has been disabled, you should still get the Install Warning dialog when you try to enable the extension. Review URL: http://codereview.chromium.org/501137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.h')
-rw-r--r--chrome/browser/extensions/extension_prefs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index 0488545..e976b53 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -58,6 +58,10 @@ class ExtensionPrefs {
// Called to change the extension's state when it is enabled/disabled.
void SetExtensionState(Extension* extension, Extension::State);
+ // If |require| is true, the preferences for |extension| will be set to
+ // require the install warning when the user tries to enable.
+ void SetShowInstallWarningOnEnable(Extension* extension, bool require);
+
// Returns the version string for the currently installed extension, or
// the empty string if not found.
std::string GetVersionString(const std::string& extension_id);
@@ -78,6 +82,9 @@ class ExtensionPrefs {
// Based on extension id, checks prefs to see if it is blacklisted.
bool IsExtensionBlacklisted(const std::string& id);
+ // Did the extension ask to escalate its permission during an upgrade?
+ bool DidExtensionEscalatePermissions(const std::string& id);
+
// Saves ExtensionInfo for each installed extension with the path to the
// version directory and the location. Blacklisted extensions won't be saved
// and neither will external extensions the user has explicitly uninstalled.
@@ -102,6 +109,14 @@ class ExtensionPrefs {
// Deletes the pref dictionary for extension |id|.
void DeleteExtensionPrefs(const std::string& id);
+ // Reads a boolean pref from |ext| with key |pref_key|.
+ // Return false if the value is false or kPrefBlacklist does not exist.
+ bool ReadBooleanFromPref(DictionaryValue* ext, const std::wstring& pref_key);
+
+ // Reads a boolean pref |pref_key| from extension with id |extension_id|.
+ bool ReadExtensionPrefBoolean(const std::string& extension_id,
+ const std::wstring& pref_key);
+
// Ensures and returns a mutable dictionary for extension |id|'s prefs.
DictionaryValue* GetOrCreateExtensionPref(const std::string& id);