summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 22:30:37 +0000
committerandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 22:30:37 +0000
commit0697f296bbfc70be2987b3ff24f9facc9e98cd97 (patch)
treeeb41fcaccbf50306a214cf08f450216c74e25f2f
parent878b089581b6661bb288c478a663817946a1ff06 (diff)
downloadchromium_src-0697f296bbfc70be2987b3ff24f9facc9e98cd97.zip
chromium_src-0697f296bbfc70be2987b3ff24f9facc9e98cd97.tar.gz
chromium_src-0697f296bbfc70be2987b3ff24f9facc9e98cd97.tar.bz2
Makes 'Cancel' the default button for extension install/uninstall confirmation dialogs.
BUG=26357 TEST=try to install any extension on Mac, verify that the default (blue) button with the key equivalent of 'Return' is the abort action, NOT the install action. Review URL: http://codereview.chromium.org/463008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33607 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/extension_install_prompt.mm11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/extension_install_prompt.mm b/chrome/browser/cocoa/extension_install_prompt.mm
index ae68d9d..5b935ce 100644
--- a/chrome/browser/cocoa/extension_install_prompt.mm
+++ b/chrome/browser/cocoa/extension_install_prompt.mm
@@ -22,11 +22,18 @@ void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
Profile* profile, Delegate* delegate, Extension* extension, SkBitmap* icon,
const std::wstring& warning_text, bool is_uninstall) {
NSAlert* alert = [[[NSAlert alloc] init] autorelease];
- [alert addButtonWithTitle:l10n_util::GetNSString(
+
+ NSButton* continueButton = [alert addButtonWithTitle:l10n_util::GetNSString(
is_uninstall ? IDS_EXTENSION_PROMPT_UNINSTALL_BUTTON :
IDS_EXTENSION_PROMPT_INSTALL_BUTTON)];
- [alert addButtonWithTitle:l10n_util::GetNSString(
+ // Clear the key equivalent (currently 'Return') because cancel is the default
+ // button.
+ [continueButton setKeyEquivalent:@""];
+
+ NSButton* cancelButton = [alert addButtonWithTitle:l10n_util::GetNSString(
IDS_EXTENSION_PROMPT_CANCEL_BUTTON)];
+ [cancelButton setKeyEquivalent:@"\r"];
+
[alert setMessageText:l10n_util::GetNSStringF(
is_uninstall ? IDS_EXTENSION_UNINSTALL_PROMPT_HEADING :
IDS_EXTENSION_INSTALL_PROMPT_HEADING,