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

Unified Diff: chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc

Issue 243643003: Improve extension uninstall flow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
index a58b6673344579a47feb6e9345ecd9063244fe51..cb08266a9f10e1f24569dab05690d977b42c5701 100644
--- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
@@ -84,7 +84,9 @@ class ExtensionUninstallDialogDelegateView : public views::DialogDelegateView {
virtual base::string16 GetDialogButtonLabel(
ui::DialogButton button) const OVERRIDE;
virtual int GetDefaultDialogButton() const OVERRIDE {
- return ui::DIALOG_BUTTON_CANCEL;
+ // Default to accept when triggered via chrome://extensions page.
+ return triggered_by_extension_ ?
+ ui::DIALOG_BUTTON_CANCEL : ui::DIALOG_BUTTON_OK;
}
virtual bool Accept() OVERRIDE;
virtual bool Cancel() OVERRIDE;
@@ -104,6 +106,7 @@ class ExtensionUninstallDialogDelegateView : public views::DialogDelegateView {
views::ImageView* icon_;
views::Label* heading_;
+ bool triggered_by_extension_;
msw 2014/04/19 01:29:37 Explicitly initialize this in the ctor initializat
Isaac (away) 2014/04/19 02:42:22 Thanks for catching that. Done.
DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialogDelegateView);
};
@@ -172,6 +175,8 @@ ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView(
heading_->SetMultiLine(true);
heading_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(heading_);
+
+ triggered_by_extension_ = triggering_extension != NULL;
}
ExtensionUninstallDialogDelegateView::~ExtensionUninstallDialogDelegateView() {
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698