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

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

Issue 199018: Add a disable button to the Extension management UI. (Closed)
Patch Set: comments Created 11 years, 3 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/extensions_service.cc ('k') | chrome/browser/resources/extensions_ui.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_ui.cc
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index c251b2f012c62ecfefb7329766083d1a81a6e00d..708b7e6246b6a2215a3c1dff882cd679f98b451e 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -121,6 +121,7 @@ void ExtensionsDOMHandler::HandleRequestExtensionsData(const Value* value) {
dom_ui_->CallJavascriptFunction(L"returnExtensionsData", results);
// Register for notifications that we need to reload the page.
+ registrar_.RemoveAll();
registrar_.Add(this, NotificationType::EXTENSION_LOADED,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
@@ -165,10 +166,15 @@ void ExtensionsDOMHandler::HandleReloadMessage(const Value* value) {
void ExtensionsDOMHandler::HandleEnableMessage(const Value* value) {
CHECK(value->IsType(Value::TYPE_LIST));
const ListValue* list = static_cast<const ListValue*>(value);
- CHECK(list->GetSize() == 1);
- std::string extension_id;
+ CHECK(list->GetSize() == 2);
+ std::string extension_id, enable_str;
CHECK(list->GetString(0, &extension_id));
- extensions_service_->EnableExtension(extension_id);
+ CHECK(list->GetString(1, &enable_str));
+ if (enable_str == "true") {
+ extensions_service_->EnableExtension(extension_id);
+ } else {
+ extensions_service_->DisableExtension(extension_id);
+ }
}
void ExtensionsDOMHandler::HandleUninstallMessage(const Value* value) {
« no previous file with comments | « chrome/browser/extensions/extensions_service.cc ('k') | chrome/browser/resources/extensions_ui.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698