Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3053)

Unified Diff: chrome/browser/extensions/extension_uninstall_dialog.cc

Issue 2860663003: Make CWS Report Abuse page the active tab after report abuse and uninstall (Closed)
Patch Set: Refactor Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..a1ce05ab8730f5d039e8d430cb96f5b603b3262b 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.cc
+++ b/chrome/browser/extensions/extension_uninstall_dialog.cc
@@ -163,21 +163,11 @@ void ExtensionUninstallDialog::OnDialogClosed(CloseAction action) {
base::string16 error;
switch (action) {
case CLOSE_ACTION_UNINSTALL_AND_REPORT_ABUSE:
+ Uninstall(success, error);
Devlin 2017/05/05 20:46:38 We should add a comment indicating why this order
catmullings 2017/05/15 22:27:55 Done.
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:
@@ -190,6 +180,20 @@ void ExtensionUninstallDialog::OnDialogClosed(CloseAction action) {
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_,

Powered by Google App Engine
This is Rietveld 408576698