diff options
Diffstat (limited to 'chrome/browser/extensions/extensions_ui.cc')
-rw-r--r-- | chrome/browser/extensions/extensions_ui.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index e150840..8dafb8e 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -68,6 +68,8 @@ ExtensionsDOMHandler::ExtensionsDOMHandler(DOMUI* dom_ui, NewCallback(this, &ExtensionsDOMHandler::HandleRequestExtensionsData)); dom_ui_->RegisterMessageCallback("inspect", NewCallback(this, &ExtensionsDOMHandler::HandleInspectMessage)); + dom_ui_->RegisterMessageCallback("uninstall", + NewCallback(this, &ExtensionsDOMHandler::HandleUninstallMessage)); } void ExtensionsDOMHandler::HandleRequestExtensionsData(const Value* value) { @@ -118,6 +120,15 @@ void ExtensionsDOMHandler::HandleInspectMessage(const Value* value) { g_browser_process->devtools_manager()->OpenDevToolsWindow(host); } +void ExtensionsDOMHandler::HandleUninstallMessage(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->GetString(0, &extension_id)); + extensions_service_->UninstallExtension(extension_id); +} + static void CreateScriptFileDetailValue( const FilePath& extension_path, const UserScript::FileList& scripts, const wchar_t* key, DictionaryValue* script_data) { |