Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5629)

Unified Diff: chrome/browser/extensions/extension_prefs.h

Issue 165414: Disable an extension when it is upgraded to a version that requires more (Closed)
Patch Set: more comments Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_prefs.h
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index c819bcd18efa5c24ce32adbb175aba63279d1ecf..291556c79b482cd8db487a623b33d2ec47622c67 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.
« no previous file with comments | « chrome/browser/extensions/extension_disabled_infobar_delegate.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698