| Index: chrome/browser/extensions/extension_uninstall_dialog.cc
|
| diff --git a/chrome/browser/extensions/extension_uninstall_dialog.cc b/chrome/browser/extensions/extension_uninstall_dialog.cc
|
| index b56187031454a7f7051d637a45ecf474c858ba7c..4b3c66321c0435604b5357a6efaf256fbd6b3f84 100644
|
| --- a/chrome/browser/extensions/extension_uninstall_dialog.cc
|
| +++ b/chrome/browser/extensions/extension_uninstall_dialog.cc
|
| @@ -126,6 +126,9 @@ void ExtensionUninstallDialog::OnImageLoaded(const std::string& extension_id,
|
| case ScopedTestDialogAutoConfirm::NONE:
|
| Show();
|
| break;
|
| + case ScopedTestDialogAutoConfirm::ACCEPT_AND_OPTION:
|
| + OnDialogClosed(CLOSE_ACTION_UNINSTALL_AND_REPORT_ABUSE);
|
| + break;
|
| case ScopedTestDialogAutoConfirm::ACCEPT:
|
| OnDialogClosed(CLOSE_ACTION_UNINSTALL);
|
| break;
|
| @@ -163,21 +166,15 @@ void ExtensionUninstallDialog::OnDialogClosed(CloseAction action) {
|
| base::string16 error;
|
| switch (action) {
|
| case CLOSE_ACTION_UNINSTALL_AND_REPORT_ABUSE:
|
| + // If the extension specifies a custom uninstall page via
|
| + // chrome.runtime.setUninstallURL, then at uninstallation its uninstall
|
| + // page opens. To ensure that the CWS Report Abuse page is the active tab
|
| + // at uninstallation, HandleReportAbuse() is called after Uninstall().
|
| + Uninstall(&success, &error);
|
| HandleReportAbuse();
|
| - // Fall through.
|
| + break;
|
| case CLOSE_ACTION_UNINSTALL: {
|
| - const Extension* current_extension =
|
| - ExtensionRegistry::Get(profile_)->GetExtensionById(
|
| - extension_->id(), ExtensionRegistry::EVERYTHING);
|
| - if (current_extension) {
|
| - success =
|
| - ExtensionSystem::Get(profile_)
|
| - ->extension_service()
|
| - ->UninstallExtension(extension_->id(), uninstall_reason_,
|
| - base::Bind(&base::DoNothing), &error);
|
| - } else {
|
| - error = base::ASCIIToUTF16(kExtensionRemovedError);
|
| - }
|
| + Uninstall(&success, &error);
|
| break;
|
| }
|
| case CLOSE_ACTION_CANCELED:
|
| @@ -186,10 +183,23 @@ void ExtensionUninstallDialog::OnDialogClosed(CloseAction action) {
|
| case CLOSE_ACTION_LAST:
|
| NOTREACHED();
|
| }
|
| -
|
| delegate_->OnExtensionUninstallDialogClosed(success, error);
|
| }
|
|
|
| +void ExtensionUninstallDialog::Uninstall(bool* success, base::string16* error) {
|
| + const Extension* current_extension =
|
| + ExtensionRegistry::Get(profile_)->GetExtensionById(
|
| + extension_->id(), ExtensionRegistry::EVERYTHING);
|
| + if (current_extension) {
|
| + *success =
|
| + ExtensionSystem::Get(profile_)->extension_service()->UninstallExtension(
|
| + extension_->id(), uninstall_reason_, base::Bind(&base::DoNothing),
|
| + error);
|
| + } else {
|
| + *error = base::ASCIIToUTF16(kExtensionRemovedError);
|
| + }
|
| +}
|
| +
|
| void ExtensionUninstallDialog::HandleReportAbuse() {
|
| chrome::NavigateParams params(
|
| profile_,
|
|
|