Index: extensions/browser/extension_prefs.cc |
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc |
index 8e56ed73ddce65707ea4252dfb57a61878d6e865..8800ec68e5dae49a7212505a59808373e0dd38a0 100644 |
--- a/extensions/browser/extension_prefs.cc |
+++ b/extensions/browser/extension_prefs.cc |
@@ -66,6 +66,9 @@ const char kPrefVersion[] = "manifest.version"; |
// Indicates whether an extension is blacklisted. |
const char kPrefBlacklist[] = "blacklist"; |
+// If extension is greylisted. |
+const char kPrefBlacklistState[] = "blacklist_state"; |
+ |
// The count of how many times we prompted the user to acknowledge an |
// extension. |
const char kPrefAcknowledgePromptCount[] = "ack_prompt_count"; |
@@ -1146,6 +1149,25 @@ void ExtensionPrefs::SetExtensionState(const std::string& extension_id, |
content_settings_store_->SetExtensionState(extension_id, enabled); |
} |
+void ExtensionPrefs::SetExtensionBlacklistState(const std::string& extension_id, |
+ BlacklistState state) { |
+ SetExtensionBlacklisted(extension_id, state == BLACKLISTED_MALWARE); |
+ UpdateExtensionPref(extension_id, kPrefBlacklistState, |
+ new base::FundamentalValue(state)); |
+} |
+ |
+BlacklistState ExtensionPrefs::GetExtensionBlacklistState( |
+ const std::string& extension_id) { |
+ if (IsExtensionBlacklisted(extension_id)) |
+ return BLACKLISTED_MALWARE; |
+ const base::DictionaryValue* ext_prefs = GetExtensionPref(extension_id); |
+ int int_value; |
+ if (ext_prefs && ext_prefs->GetInteger(kPrefBlacklistState, &int_value)) |
+ return static_cast<BlacklistState>(int_value); |
+ |
+ return NOT_BLACKLISTED; |
+} |
+ |
std::string ExtensionPrefs::GetVersionString(const std::string& extension_id) { |
const base::DictionaryValue* extension = GetExtensionPref(extension_id); |
if (!extension) |