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

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

Issue 9960087: Revert 13676 - Revert 131665 - 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
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 2c5dc80dedba1f11412b7935529e3c7af619c25d..91c1a6dbc3bd952124b5a45a99103297ef96b422 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -57,6 +57,9 @@ const char kPrefOrphanAcknowledged[] = "ack_orphan";
// Indicates whether to show an install warning when the user enables.
const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable";
+// Indicates whether the extension was updated while it was disabled.
+const char kPrefDisableReason[] = "disable_reason";
+
// A preference that tracks browser action toolbar configuration. This is a list
// object stored in the Preferences file. The extensions are stored by ID.
const char kExtensionToolbar[] = "extensions.toolbar";
@@ -673,6 +676,27 @@ void ExtensionPrefs::SetDidExtensionEscalatePermissions(
Value::CreateBooleanValue(did_escalate));
}
+Extension::DisableReason ExtensionPrefs::GetDisableReason(
+ const std::string& extension_id) {
+ int value = -1;
+ if (ReadExtensionPrefInteger(extension_id, kPrefDisableReason, &value) &&
+ value >= 0 && value < Extension::DISABLE_LAST) {
+ return static_cast<Extension::DisableReason>(value);
+ }
+ return Extension::DISABLE_UNKNOWN;
+}
+
+void ExtensionPrefs::SetDisableReason(const std::string& extension_id,
+ Extension::DisableReason disable_reason) {
+ UpdateExtensionPref(
+ extension_id, kPrefDisableReason,
+ Value::CreateIntegerValue(static_cast<int>(disable_reason)));
+}
+
+void ExtensionPrefs::RemoveDisableReason(const std::string& extension_id) {
+ UpdateExtensionPref(extension_id, kPrefDisableReason, NULL);
+}
+
void ExtensionPrefs::UpdateBlacklist(
const std::set<std::string>& blacklist_set) {
std::vector<std::string> remove_pref_ids;
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698