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) { |