diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 22:32:39 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 22:32:39 +0000 |
commit | 0c6da50c299be943b4c04a3953e0931734af7eaf (patch) | |
tree | b5fa120b75591c1fa56a07232cf685ac1b2a8eb8 /chrome/browser/extensions/extension_prefs.h | |
parent | a7918784c2ac95844ae775be2fef06cd3efb092c (diff) | |
download | chromium_src-0c6da50c299be943b4c04a3953e0931734af7eaf.zip chromium_src-0c6da50c299be943b4c04a3953e0931734af7eaf.tar.gz chromium_src-0c6da50c299be943b4c04a3953e0931734af7eaf.tar.bz2 |
Disable an extension when it is upgraded to a version that requires more
permissions then before, and prompt the user to re-enable.
Incidentally, this required adding support for disabling extensions.
BUG=12140
TEST=covered by unit tests
Review URL: http://codereview.chromium.org/165414
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.h')
-rw-r--r-- | chrome/browser/extensions/extension_prefs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h index c819bcd..291556c 100644 --- a/chrome/browser/extensions/extension_prefs.h +++ b/chrome/browser/extensions/extension_prefs.h @@ -43,6 +43,12 @@ class ExtensionPrefs { void OnExtensionUninstalled(const Extension* extension, bool external_uninstall); + // Returns the state (enabled/disabled) of the given extension. + Extension::State GetExtensionState(const std::string& extension_id); + + // Called to change the extension's state when it is enabled/disabled. + void SetExtensionState(Extension* extension, Extension::State); + // Returns base extensions install directory. const FilePath& install_directory() const { return install_directory_; } @@ -73,6 +79,9 @@ class ExtensionPrefs { // Ensures and returns a mutable dictionary for extension |id|'s prefs. DictionaryValue* GetOrCreateExtensionPref(const std::string& id); + // Same as above, but returns NULL if it doesn't exist. + DictionaryValue* GetExtensionPref(const std::string& id); + // Checks if kPrefBlacklist is set to true in the DictionaryValue. // Return false if the value is false or kPrefBlacklist does not exist. // This is used to decide if an extension is blacklisted. @@ -106,6 +115,10 @@ class InstalledExtensions { // the callback. void VisitInstalledExtensions(Callback *callback); + // Same as above, but only for the given extension. + void VisitInstalledExtension(const std::string& extension_id, + Callback *callback); + private: // A copy of the extensions pref dictionary so that this can be passed // around without a dependency on prefs. |