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

Unified Diff: chrome/browser/app_modal_dialog_mac.mm

Issue 181006: Make the default ok/cancel button come from the pak files.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_modal_dialog_mac.mm
===================================================================
--- chrome/browser/app_modal_dialog_mac.mm (revision 24737)
+++ chrome/browser/app_modal_dialog_mac.mm (working copy)
@@ -6,10 +6,11 @@
#import <Cocoa/Cocoa.h>
-#include "app/l10n_util.h"
+#include "app/l10n_util_mac.h"
#include "app/message_box_flags.h"
#include "base/sys_string_conversions.h"
#include "grit/generated_resources.h"
+#include "grit/app_strings.h"
Mark Mentovai 2009/08/28 18:16:04 sortile
// Helper object that receives the notification that the dialog/sheet is
// going away. Is responsible for cleaning itself up.
@@ -78,9 +79,8 @@
// Determine the names of the dialog buttons based on the flags. "Default"
// is the OK button. "Other" is the cancel button. We don't use the
// "Alternate" button in NSRunAlertPanel.
- // TODO(pinkerton): Need to find the right localized strings for these.
- NSString* default_button = NSLocalizedString(@"OK", nil);
- NSString* other_button = NSLocalizedString(@"Cancel", nil);
+ NSString* default_button = l10n_util::GetNSStringWithFixup(IDS_APP_OK);
+ NSString* other_button = l10n_util::GetNSStringWithFixup(IDS_APP_CANCEL);
bool text_field = false;
bool one_button = false;
switch (dialog_flags_) {
@@ -89,12 +89,10 @@
break;
case MessageBoxFlags::kIsJavascriptConfirm:
if (is_before_unload_dialog_) {
- std::string button_text = l10n_util::GetStringUTF8(
+ default_button = l10n_util::GetNSStringWithFixup(
IDS_BEFOREUNLOAD_MESSAGEBOX_OK_BUTTON_LABEL);
- default_button = base::SysUTF8ToNSString(button_text);
- button_text = l10n_util::GetStringUTF8(
+ other_button = l10n_util::GetNSStringWithFixup(
IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL);
- other_button = base::SysUTF8ToNSString(button_text);
}
break;
case MessageBoxFlags::kIsJavascriptPrompt:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698