diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 03:27:39 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 03:27:39 +0000 |
commit | a487176a89c3a2aff8226c8c1d9acc55ce70e483 (patch) | |
tree | cdbace8fd15777bad4a317328c5c7431d27f1d42 /chrome/browser/extensions/extensions_ui.cc | |
parent | b6a040a170be44d208a5ab379931c571232dd3e2 (diff) | |
download | chromium_src-a487176a89c3a2aff8226c8c1d9acc55ce70e483.zip chromium_src-a487176a89c3a2aff8226c8c1d9acc55ce70e483.tar.gz chromium_src-a487176a89c3a2aff8226c8c1d9acc55ce70e483.tar.bz2 |
Add confirmation on extension uninstallation.
Reuses the Install dialog (and makes it slightly more generic).
BUG=27162
TEST=None
Review URL: http://codereview.chromium.org/376030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_ui.cc')
-rw-r--r-- | chrome/browser/extensions/extensions_ui.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index c411444..f66ba3e 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -15,6 +15,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/debugger/devtools_manager.h" +#include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" #include "chrome/browser/extensions/extension_message_service.h" #include "chrome/browser/extensions/extensions_service.h" @@ -381,7 +382,28 @@ void ExtensionsDOMHandler::HandleUninstallMessage(const Value* value) { CHECK(list->GetSize() == 1); std::string extension_id; CHECK(list->GetString(0, &extension_id)); - extensions_service_->UninstallExtension(extension_id, false); + + Extension *extension = extensions_service_->GetExtensionById(extension_id); + if (!extension) + return; + + FilePath icon_path = + extension->GetIconPath(Extension::EXTENSION_ICON_LARGE).GetFilePath(); + scoped_ptr<SkBitmap> uninstall_icon; + CrxInstaller::DecodeInstallIcon(icon_path, &uninstall_icon); + + extension_id_uninstalling_ = extension_id; + ExtensionInstallUI client(dom_ui_->GetProfile()); + client.ConfirmUninstall(this, extension, uninstall_icon.get()); +} + +void ExtensionsDOMHandler::InstallUIProceed() { + extensions_service_->UninstallExtension(extension_id_uninstalling_, false); + extension_id_uninstalling_ = ""; +} + +void ExtensionsDOMHandler::InstallUIAbort() { + extension_id_uninstalling_ = ""; } void ExtensionsDOMHandler::HandleOptionsMessage(const Value* value) { |