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

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

Issue 10014005: Add a preference for why an extension is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 39c0360986c0bb44495280abafcfd12b16aa39e9..9382784af9ad5851f00fb48b51898203c2bef16e 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -71,6 +71,14 @@ class ExtensionPrefs : public ExtensionContentSettingsStore::Observer,
LAUNCH_DEFAULT = LAUNCH_REGULAR
};
+ // Used to record the reason an extension was disabled.
+ enum DisableReason {
+ DISABLE_UNKNOWN,
+ DISABLE_USER_ACTION,
+ DISABLE_PERMISSIONS_INCREASE,
+ DISABLE_RELOAD,
+ };
+
// Does not assume ownership of |prefs| and |extension_pref_value_map|.
// Note that you must call Init() to finalize construction.
ExtensionPrefs(PrefService* prefs,
@@ -139,6 +147,11 @@ class ExtensionPrefs : public ExtensionContentSettingsStore::Observer,
void SetDidExtensionEscalatePermissions(const Extension* extension,
bool did_escalate);
+ // Getter and setter for disabled reason.
+ DisableReason GetDisableReason(const std::string& extension_id);
+ void SetDisableReason(const std::string& extension_id,
+ DisableReason disable_reason);
+
// Returns the version string for the currently installed extension, or
// the empty string if not found.
std::string GetVersionString(const std::string& extension_id);

Powered by Google App Engine
This is Rietveld 408576698