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

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: Use ctor initialization 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..db1432068c6a32721328ac1f6f4935077c934ce8 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_;
DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialogDelegateView);
};
@@ -158,7 +161,8 @@ ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView(
const extensions::Extension* extension,
const extensions::Extension* triggering_extension,
gfx::ImageSkia* icon)
- : dialog_(dialog_view) {
+ : dialog_(dialog_view),
+ triggered_by_extension_(triggering_extension != NULL) {
// Scale down to icon size, but allow smaller icons (don't scale up).
gfx::Size size(icon->width(), icon->height());
if (size.width() > kIconSize || size.height() > kIconSize)
« 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