| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_tabs_module.h" | 10 #include "chrome/browser/extensions/extension_tabs_module.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 DCHECK(!extension_->options_url().is_empty()); | 102 DCHECK(!extension_->options_url().is_empty()); |
| 103 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension_, | 103 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension_, |
| 104 browser_); | 104 browser_); |
| 105 break; | 105 break; |
| 106 case DISABLE: { | 106 case DISABLE: { |
| 107 ExtensionsService* extension_service = profile_->GetExtensionsService(); | 107 ExtensionsService* extension_service = profile_->GetExtensionsService(); |
| 108 extension_service->DisableExtension(extension_->id()); | 108 extension_service->DisableExtension(extension_->id()); |
| 109 break; | 109 break; |
| 110 } | 110 } |
| 111 case UNINSTALL: { | 111 case UNINSTALL: { |
| 112 scoped_ptr<SkBitmap> uninstall_icon; | 112 install_ui_.reset(new ExtensionInstallUI(profile_)); |
| 113 Extension::DecodeIcon(extension_, Extension::EXTENSION_ICON_LARGE, | 113 install_ui_->ConfirmUninstall(this, extension_); |
| 114 &uninstall_icon); | |
| 115 | |
| 116 ExtensionInstallUI client(profile_); | |
| 117 client.ConfirmUninstall(this, extension_, uninstall_icon.get()); | |
| 118 break; | 114 break; |
| 119 } | 115 } |
| 120 case MANAGE: { | 116 case MANAGE: { |
| 121 browser_->OpenURL(GURL(chrome::kChromeUIExtensionsURL), GURL(), | 117 browser_->OpenURL(GURL(chrome::kChromeUIExtensionsURL), GURL(), |
| 122 SINGLETON_TAB, PageTransition::LINK); | 118 SINGLETON_TAB, PageTransition::LINK); |
| 123 break; | 119 break; |
| 124 } | 120 } |
| 125 case INSPECT_POPUP: { | 121 case INSPECT_POPUP: { |
| 126 delegate_->InspectPopup(extension_action_); | 122 delegate_->InspectPopup(extension_action_); |
| 127 break; | 123 break; |
| 128 } | 124 } |
| 129 default: | 125 default: |
| 130 NOTREACHED() << "Unknown option"; | 126 NOTREACHED() << "Unknown option"; |
| 131 break; | 127 break; |
| 132 } | 128 } |
| 133 } | 129 } |
| 134 | 130 |
| 135 void ExtensionContextMenuModel::InstallUIProceed(bool create_app) { | 131 void ExtensionContextMenuModel::InstallUIProceed(bool create_app) { |
| 136 DCHECK(!create_app); | 132 DCHECK(!create_app); |
| 137 | 133 |
| 138 std::string id = extension_->id(); | 134 std::string id = extension_->id(); |
| 139 profile_->GetExtensionsService()->UninstallExtension(id, false); | 135 profile_->GetExtensionsService()->UninstallExtension(id, false); |
| 140 } | 136 } |
| OLD | NEW |