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

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

Issue 98463005: Enable/disable extensions upon changes in blacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 9f416a0ba0e99006e0c5af8c8b1d0c920ae36769..bacaefabe9ce823910c447dad60529309d5b9dd5 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -67,6 +67,9 @@ const char kPrefVersion[] = "manifest.version";
// Indicates whether an extension is blacklisted.
const char kPrefBlacklist[] = "blacklist";
+// If extension is greylisted.
+const char kPrefGreylist[] = "greylist";
+
// The count of how many times we prompted the user to acknowledge an
// extension.
const char kPrefAcknowledgePromptCount[] = "ack_prompt_count";
@@ -1147,6 +1150,19 @@ void ExtensionPrefs::SetExtensionState(const std::string& extension_id,
content_settings_store_->SetExtensionState(extension_id, enabled);
}
+void ExtensionPrefs::SetExtensionGreylisted(const std::string& extension_id,
+ bool state) {
+ UpdateExtensionPref(extension_id, kPrefGreylist,
+ new base::FundamentalValue(state));
+}
+
+bool ExtensionPrefs::IsExtensionGreylisted(const std::string& extension_id) {
+ const base::DictionaryValue* ext_prefs = GetExtensionPref(extension_id);
+ bool bool_value;
+ return ext_prefs && ext_prefs->GetBoolean(kPrefGreylist, &bool_value)
+ && bool_value;
+}
+
std::string ExtensionPrefs::GetVersionString(const std::string& extension_id) {
const base::DictionaryValue* extension = GetExtensionPref(extension_id);
if (!extension)

Powered by Google App Engine
This is Rietveld 408576698