diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 18:29:54 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 18:29:54 +0000 |
commit | 39644406156e68acc8e6bf1b9de94f0a6ec2d996 (patch) | |
tree | 94e59c99f23df500c49f9f8c80843b6ba918d67b /chrome/browser/app_modal_dialog_mac.mm | |
parent | dc24991d36fe83feab0a651473937fa78abf458e (diff) | |
download | chromium_src-39644406156e68acc8e6bf1b9de94f0a6ec2d996.zip chromium_src-39644406156e68acc8e6bf1b9de94f0a6ec2d996.tar.gz chromium_src-39644406156e68acc8e6bf1b9de94f0a6ec2d996.tar.bz2 |
Alert dialogs only get one button.
Review URL: http://codereview.chromium.org/113638
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog_mac.mm')
-rw-r--r-- | chrome/browser/app_modal_dialog_mac.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/app_modal_dialog_mac.mm b/chrome/browser/app_modal_dialog_mac.mm index 8dac668..db7bd6d04 100644 --- a/chrome/browser/app_modal_dialog_mac.mm +++ b/chrome/browser/app_modal_dialog_mac.mm @@ -81,10 +81,11 @@ void AppModalDialog::CreateAndShowDialog() { // TODO(pinkerton): Need to find the right localized strings for these. NSString* default_button = NSLocalizedString(@"OK", nil); NSString* other_button = NSLocalizedString(@"Cancel", nil); - BOOL text_field = NO; + bool text_field = false; + bool one_button = false; switch (dialog_flags_) { case MessageBoxFlags::kIsJavascriptAlert: - // OK & Cancel are fine for these types of alerts. + one_button = true; break; case MessageBoxFlags::kIsJavascriptConfirm: if (is_before_unload_dialog_) { @@ -97,7 +98,7 @@ void AppModalDialog::CreateAndShowDialog() { } break; case MessageBoxFlags::kIsJavascriptPrompt: - text_field = YES; + text_field = true; break; default: @@ -120,7 +121,8 @@ void AppModalDialog::CreateAndShowDialog() { [alert setInformativeText:base::SysWideToNSString(message_text_)]; [alert setMessageText:base::SysWideToNSString(title_)]; [alert addButtonWithTitle:default_button]; - [alert addButtonWithTitle:other_button]; + if (!one_button) + [alert addButtonWithTitle:other_button]; [alert beginSheetModalForWindow:nil // nil here makes it app-modal modalDelegate:helper |