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

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..0d22d76d8c0fd4007bd6efea7727c647efc297e8 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 by user gesture.
meacer 2014/04/18 23:45:23 This dialog is always triggered by a user gesture
Isaac (away) 2014/04/18 23:54:51 Done.
+ return triggering_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_;
+ const extensions::Extension* triggering_extension_;
DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialogDelegateView);
};
@@ -172,6 +175,8 @@ ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView(
heading_->SetMultiLine(true);
heading_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(heading_);
+
+ triggering_extension_ = triggering_extension;
}
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