diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 18:54:43 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 18:54:43 +0000 |
commit | f7987cf0ff7c4fd69d0a2e59861e8c21a169f176 (patch) | |
tree | 179e12a4a8703a48c3d1053dae97adb714c1c89b /chrome/browser/platform_util_mac.mm | |
parent | 2ba83f79188bf7b9bc6589c163c8978c1a9b6e3f (diff) | |
download | chromium_src-f7987cf0ff7c4fd69d0a2e59861e8c21a169f176.zip chromium_src-f7987cf0ff7c4fd69d0a2e59861e8c21a169f176.tar.gz chromium_src-f7987cf0ff7c4fd69d0a2e59861e8c21a169f176.tar.bz2 |
Make a new yes/no messagebox wrapper function, use it in the bookmark alert.
BUG=http://crbug.com/34481; http://crbug.com/40011
TEST=on Mac/ChromeOS, have at least 15 bookmarks on bookmarks bar or other bookmarks,
right click on one of those and click on Open all bookmarks. An confirmation
dialog box should be shown. No other visible change.
Review URL: http://codereview.chromium.org/1687017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/platform_util_mac.mm')
-rw-r--r-- | chrome/browser/platform_util_mac.mm | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm index 43d9582..789059a 100644 --- a/chrome/browser/platform_util_mac.mm +++ b/chrome/browser/platform_util_mac.mm @@ -59,14 +59,31 @@ bool IsVisible(gfx::NativeView view) { void SimpleErrorBox(gfx::NativeWindow parent, const string16& title, const string16& message) { + // Ignore the title; it's the window title on other platforms and ignorable. NSAlert* alert = [[[NSAlert alloc] init] autorelease]; [alert addButtonWithTitle:l10n_util::GetNSString(IDS_OK)]; - [alert setMessageText:base::SysUTF16ToNSString(title)]; - [alert setInformativeText:base::SysUTF16ToNSString(message)]; + [alert setMessageText:base::SysUTF16ToNSString(message)]; [alert setAlertStyle:NSWarningAlertStyle]; [alert runModal]; } +bool SimpleYesNoBox(gfx::NativeWindow parent, + const string16& title, + const string16& message) { + // Ignore the title; it's the window title on other platforms and ignorable. + NSAlert* alert = [[[NSAlert alloc] init] autorelease]; + [alert setMessageText:base::SysUTF16ToNSString(message)]; + [alert setAlertStyle:NSWarningAlertStyle]; + + [alert addButtonWithTitle: + l10n_util::GetNSString(IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL)]; + [alert addButtonWithTitle: + l10n_util::GetNSString(IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)]; + + NSInteger result = [alert runModal]; + return result == NSAlertFirstButtonReturn; +} + string16 GetVersionStringModifier() { #if defined(GOOGLE_CHROME_BUILD) NSBundle* bundle = mac_util::MainAppBundle(); |