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

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 98463005: Enable/disable extensions upon changes in blacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added UI, store blacklist state in prefs, +2 unittests. 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/ui/webui/extensions/extension_settings_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index 3ef1ffc3b3e620dd4c8dc927a3e4b0f997d1f6e6..3db20f2ab5d75615b2b6b5d99302f2f94cc1e2dc 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -26,6 +26,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
+#include "chrome/browser/extensions/blacklist_state.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/devtools_util.h"
@@ -242,6 +243,9 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue(
extension_data->SetBoolean("homepageProvided",
ManifestURL::GetHomepageURL(extension).is_valid());
+ BlacklistState blacklist_state =
+ extension_service_->extension_prefs()->GetExtensionBlacklistState(
+ extension->id());
base::string16 location_text;
if (Manifest::IsPolicyLocation(extension->location())) {
location_text = l10n_util::GetStringUTF16(
@@ -253,6 +257,26 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue(
} else if (extension->location() == Manifest::EXTERNAL_REGISTRY) {
location_text = l10n_util::GetStringUTF16(
IDS_OPTIONS_INSTALL_LOCATION_3RD_PARTY);
+ } else if (blacklist_state != NOT_BLACKLISTED) {
+ switch (blacklist_state) {
+ case BLACKLISTED_SECURITY_VULNERABILITY:
+ location_text = l10n_util::GetStringUTF16(
+ IDS_OPTIONS_BLACKLISTED_SECURITY_VULNERABILITY);
+ break;
+
+ case BLACKLISTED_CWS_POLICY_VIOLATION:
+ location_text = l10n_util::GetStringUTF16(
+ IDS_OPTIONS_BLACKLISTED_CWS_POLICY_VIOLATION);
+ break;
+
+ case BLACKLISTED_POTENTIALLY_UNWANTED:
+ location_text = l10n_util::GetStringUTF16(
+ IDS_OPTIONS_BLACKLISTED_POTENTIALLY_UNWANTED);
+ break;
+
+ default:
+ break;
+ }
}
extension_data->SetString("locationText", location_text);

Powered by Google App Engine
This is Rietveld 408576698