diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 00:21:51 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 00:21:51 +0000 |
commit | fee565773acff331a7ef40f0c30d3fb6f05c3c9c (patch) | |
tree | 6e7f0828e12daaa74885ebac14fac6197462aadd /chrome | |
parent | a980002843fab42a1755c16285d3cb06ad6be38b (diff) | |
download | chromium_src-fee565773acff331a7ef40f0c30d3fb6f05c3c9c.zip chromium_src-fee565773acff331a7ef40f0c30d3fb6f05c3c9c.tar.gz chromium_src-fee565773acff331a7ef40f0c30d3fb6f05c3c9c.tar.bz2 |
views: Change DialogDelegate::GetDialogButtonLabel() to string16.
BUG=68267
R=sky@chromium.org
Review URL: http://codereview.chromium.org/8176012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
36 files changed, 133 insertions, 144 deletions
diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc index 40650eb..6a005503 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.cc +++ b/chrome/browser/chromeos/external_protocol_dialog.cc @@ -52,10 +52,9 @@ int ExternalProtocolDialog::GetDialogButtons() const { return ui::MessageBoxFlags::DIALOGBUTTON_OK; } -std::wstring ExternalProtocolDialog::GetDialogButtonLabel( +string16 ExternalProtocolDialog::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT)); + return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT); } string16 ExternalProtocolDialog::GetWindowTitle() const { diff --git a/chrome/browser/chromeos/external_protocol_dialog.h b/chrome/browser/chromeos/external_protocol_dialog.h index d726b3b..ab75c71 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.h +++ b/chrome/browser/chromeos/external_protocol_dialog.h @@ -31,8 +31,8 @@ class ExternalProtocolDialog : public views::DialogDelegate { // views::DialogDelegate Methods: virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Accept() OVERRIDE; diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc index bfe04b5..8639965 100644 --- a/chrome/browser/chromeos/options/network_config_view.cc +++ b/chrome/browser/chromeos/options/network_config_view.cc @@ -61,11 +61,11 @@ gfx::NativeWindow NetworkConfigView::GetNativeWindow() const { return GetWidget()->GetNativeWindow(); } -std::wstring NetworkConfigView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_CONNECT)); - return std::wstring(); +string16 NetworkConfigView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) + return l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_CONNECT); + return string16(); } bool NetworkConfigView::IsDialogButtonEnabled( diff --git a/chrome/browser/chromeos/options/network_config_view.h b/chrome/browser/chromeos/options/network_config_view.h index 672b83e..9743979 100644 --- a/chrome/browser/chromeos/options/network_config_view.h +++ b/chrome/browser/chromeos/options/network_config_view.h @@ -49,8 +49,8 @@ class NetworkConfigView : public views::DialogDelegateView, gfx::NativeWindow GetNativeWindow() const; // views::DialogDelegate methods. - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsDialogButtonEnabled( MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/ui/login/login_prompt_win.cc b/chrome/browser/ui/login/login_prompt_win.cc index 93d855d..a112a00 100644 --- a/chrome/browser/ui/login/login_prompt_win.cc +++ b/chrome/browser/ui/login/login_prompt_win.cc @@ -43,9 +43,9 @@ class LoginHandlerWin : public LoginHandler, } // views::DialogDelegate methods: - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) return l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_OK_BUTTON_LABEL); return DialogDelegate::GetDialogButtonLabel(button); } diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc index a36802a..f8728ee 100644 --- a/chrome/browser/ui/views/about_chrome_view.cc +++ b/chrome/browser/ui/views/about_chrome_view.cc @@ -500,21 +500,21 @@ void AboutChromeView::ViewHierarchyChanged(bool is_add, //////////////////////////////////////////////////////////////////////////////// // AboutChromeView, views::DialogDelegate implementation: -std::wstring AboutChromeView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_RELAUNCH_AND_UPDATE)); - } else if (button == MessageBoxFlags::DIALOGBUTTON_CANCEL) { +string16 AboutChromeView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) { + return l10n_util::GetStringUTF16(IDS_RELAUNCH_AND_UPDATE); + } else if (button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) { if (restart_button_visible_) - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_NOT_NOW)); + return l10n_util::GetStringUTF16(IDS_NOT_NOW); // The OK button (which is the default button) has been re-purposed to be // 'Restart Now' so we want the Cancel button should have the label // OK but act like a Cancel button in all other ways. - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_OK)); + return l10n_util::GetStringUTF16(IDS_OK); } NOTREACHED(); - return L""; + return string16(); } string16 AboutChromeView::GetWindowTitle() const { diff --git a/chrome/browser/ui/views/about_chrome_view.h b/chrome/browser/ui/views/about_chrome_view.h index 2bb2467..d8bd35e 100644 --- a/chrome/browser/ui/views/about_chrome_view.h +++ b/chrome/browser/ui/views/about_chrome_view.h @@ -56,12 +56,12 @@ class AboutChromeView : public views::DialogDelegateView, views::View* child) OVERRIDE; // Overridden from views::DialogDelegate: - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsDialogButtonEnabled( - MessageBoxFlags::DialogButton button) const OVERRIDE; + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsDialogButtonVisible( - MessageBoxFlags::DialogButton button) const OVERRIDE; + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual int GetDefaultDialogButton() const OVERRIDE; virtual bool CanResize() const OVERRIDE; virtual bool CanMaximize() const OVERRIDE; diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc index 6800649..ba23cc6 100644 --- a/chrome/browser/ui/views/collected_cookies_win.cc +++ b/chrome/browser/ui/views/collected_cookies_win.cc @@ -362,9 +362,9 @@ int CollectedCookiesWin::GetDialogButtons() const { return MessageBoxFlags::DIALOGBUTTON_CANCEL; } -std::wstring CollectedCookiesWin::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLOSE)); +string16 CollectedCookiesWin::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { + return l10n_util::GetStringUTF16(IDS_CLOSE); } void CollectedCookiesWin::DeleteDelegate() { diff --git a/chrome/browser/ui/views/collected_cookies_win.h b/chrome/browser/ui/views/collected_cookies_win.h index 1169140..5f467f7 100644 --- a/chrome/browser/ui/views/collected_cookies_win.h +++ b/chrome/browser/ui/views/collected_cookies_win.h @@ -46,8 +46,8 @@ class CollectedCookiesWin : public views::DialogDelegate, // views::DialogDelegate: virtual string16 GetWindowTitle() const OVERRIDE; virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Cancel() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index cc345a0..0aee131 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -323,13 +323,11 @@ gfx::Size CreateApplicationShortcutView::GetPreferredSize() { return gfx::Size(kDialogWidth, height); } -std::wstring CreateApplicationShortcutView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_COMMIT)); - } - - return std::wstring(); +string16 CreateApplicationShortcutView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) + return l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_COMMIT); + return string16(); } bool CreateApplicationShortcutView::IsDialogButtonEnabled( diff --git a/chrome/browser/ui/views/create_application_shortcut_view.h b/chrome/browser/ui/views/create_application_shortcut_view.h index a019545..8e7eb77 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.h +++ b/chrome/browser/ui/views/create_application_shortcut_view.h @@ -43,8 +43,8 @@ class CreateApplicationShortcutView : public views::DialogDelegateView, virtual gfx::Size GetPreferredSize() OVERRIDE; // Overridden from views::DialogDelegate: - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsDialogButtonEnabled( MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool CanResize() const OVERRIDE; diff --git a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc index 4cadace..11d5293 100644 --- a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc +++ b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc @@ -37,10 +37,10 @@ DownloadInProgressDialogView::DownloadInProgressDialogView(Browser* browser) explanation_text = UTF16ToWide(l10n_util::GetStringFUTF16( IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION, product_name_)); - ok_button_text_ = UTF16ToWide(l10n_util::GetStringUTF16( - IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL)); - cancel_button_text_ = UTF16ToWide(l10n_util::GetStringUTF16( - IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL)); + ok_button_text_ = l10n_util::GetStringUTF16( + IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL); + cancel_button_text_ = l10n_util::GetStringUTF16( + IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL); } else { warning_text = UTF16ToWide(l10n_util::GetStringFUTF16( IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING, @@ -49,10 +49,10 @@ DownloadInProgressDialogView::DownloadInProgressDialogView(Browser* browser) explanation_text = UTF16ToWide(l10n_util::GetStringFUTF16( IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION, product_name_)); - ok_button_text_ = UTF16ToWide(l10n_util::GetStringUTF16( - IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL)); - cancel_button_text_ = UTF16ToWide(l10n_util::GetStringUTF16( - IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL)); + ok_button_text_ = l10n_util::GetStringUTF16( + IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL); + cancel_button_text_ = l10n_util::GetStringUTF16( + IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL); } // There are two lines of text: the bold warning label and the text @@ -97,8 +97,8 @@ gfx::Size DownloadInProgressDialogView::GetPreferredSize() { return dialog_dimensions_; } -std::wstring DownloadInProgressDialogView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { +string16 DownloadInProgressDialogView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { if (button == MessageBoxFlags::DIALOGBUTTON_OK) return ok_button_text_; diff --git a/chrome/browser/ui/views/download/download_in_progress_dialog_view.h b/chrome/browser/ui/views/download/download_in_progress_dialog_view.h index c65d06a..0464bdd 100644 --- a/chrome/browser/ui/views/download/download_in_progress_dialog_view.h +++ b/chrome/browser/ui/views/download/download_in_progress_dialog_view.h @@ -34,8 +34,8 @@ class DownloadInProgressDialogView : public views::DialogDelegateView { virtual gfx::Size GetPreferredSize() OVERRIDE; // views::DialogDelegate: - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual int GetDefaultDialogButton() const OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; @@ -47,8 +47,8 @@ class DownloadInProgressDialogView : public views::DialogDelegateView { views::Label* warning_; views::Label* explanation_; - std::wstring ok_button_text_; - std::wstring cancel_button_text_; + string16 ok_button_text_; + string16 cancel_button_text_; string16 product_name_; diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index 45a27f6..cdbad68 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc @@ -71,8 +71,8 @@ class ExtensionInstallDialogView : public views::DialogDelegateView, private: // views::DialogDelegateView: - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual int GetDefaultDialogButton() const OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; @@ -256,18 +256,18 @@ ExtensionInstallDialogView::ExtensionInstallDialogView( ExtensionInstallDialogView::~ExtensionInstallDialogView() { } -std::wstring ExtensionInstallDialogView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { +string16 ExtensionInstallDialogView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { switch (button) { - case MessageBoxFlags::DIALOGBUTTON_OK: - return UTF16ToWide(prompt_.GetAcceptButtonLabel()); + case ui::MessageBoxFlags::DIALOGBUTTON_OK: + return prompt_.GetAcceptButtonLabel(); case MessageBoxFlags::DIALOGBUTTON_CANCEL: return prompt_.HasAbortButtonLabel() ? - UTF16ToWide(prompt_.GetAbortButtonLabel()) : - UTF16ToWide(l10n_util::GetStringUTF16(IDS_CANCEL)); + prompt_.GetAbortButtonLabel() : + l10n_util::GetStringUTF16(IDS_CANCEL); default: NOTREACHED(); - return std::wstring(); + return string16(); } } 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 0e196e3..6c1be1d 100644 --- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc @@ -66,8 +66,8 @@ class ExtensionUninstallDialogDelegateView : public views::DialogDelegateView { private: // views::DialogDelegate: - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual int GetDefaultDialogButton() const OVERRIDE { return MessageBoxFlags::DIALOGBUTTON_CANCEL; @@ -159,17 +159,16 @@ ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView( ExtensionUninstallDialogDelegateView::~ExtensionUninstallDialogDelegateView() { } -std::wstring ExtensionUninstallDialogDelegateView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { +string16 ExtensionUninstallDialogDelegateView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { switch (button) { - case MessageBoxFlags::DIALOGBUTTON_OK: - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_UNINSTALL_BUTTON)); - case MessageBoxFlags::DIALOGBUTTON_CANCEL: - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CANCEL)); + case ui::MessageBoxFlags::DIALOGBUTTON_OK: + return l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_UNINSTALL_BUTTON); + case ui::MessageBoxFlags::DIALOGBUTTON_CANCEL: + return l10n_util::GetStringUTF16(IDS_CANCEL); default: NOTREACHED(); - return L""; + return string16(); } } diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index b542612..1aa049d 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc @@ -59,14 +59,12 @@ int ExternalProtocolDialog::GetDefaultDialogButton() const { return ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; } -std::wstring ExternalProtocolDialog::GetDialogButtonLabel( +string16 ExternalProtocolDialog::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT)); + return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT); else - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CANCEL_BUTTON_TEXT)); + return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CANCEL_BUTTON_TEXT); } string16 ExternalProtocolDialog::GetWindowTitle() const { diff --git a/chrome/browser/ui/views/external_protocol_dialog.h b/chrome/browser/ui/views/external_protocol_dialog.h index 1abc502..5a17235 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.h +++ b/chrome/browser/ui/views/external_protocol_dialog.h @@ -33,8 +33,8 @@ class ExternalProtocolDialog : public views::DialogDelegate { // views::DialogDelegate methods: virtual int GetDefaultDialogButton() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index b4be66c..be07001 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -238,8 +238,8 @@ class HungRendererDialogView : public views::DialogDelegateView, virtual string16 GetWindowTitle() const OVERRIDE; virtual void WindowClosing() OVERRIDE; virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual views::View* GetExtraView() OVERRIDE; virtual bool Accept(bool window_closing) OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; @@ -386,12 +386,11 @@ int HungRendererDialogView::GetDialogButtons() const { return MessageBoxFlags::DIALOGBUTTON_OK; } -std::wstring HungRendererDialogView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { +string16 HungRendererDialogView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { if (button == MessageBoxFlags::DIALOGBUTTON_OK) - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_BROWSER_HANGMONITOR_RENDERER_WAIT)); - return std::wstring(); + return l10n_util::GetStringUTF16(IDS_BROWSER_HANGMONITOR_RENDERER_WAIT); + return string16(); } views::View* HungRendererDialogView::GetExtraView() { diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc index afd2661..1c6382f 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc @@ -64,14 +64,14 @@ void ImportLockDialogView::Layout() { height() - 2 * views::kPanelVertMargin); } -std::wstring ImportLockDialogView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { +string16 ImportLockDialogView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { if (button == MessageBoxFlags::DIALOGBUTTON_OK) { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_OK)); + return l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_OK); } else if (button == MessageBoxFlags::DIALOGBUTTON_CANCEL) { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_CANCEL)); + return l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_CANCEL); } - return std::wstring(); + return string16(); } bool ImportLockDialogView::IsModal() const { diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.h b/chrome/browser/ui/views/importer/import_lock_dialog_view.h index d5d6735..e35991b 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.h +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.h @@ -33,8 +33,8 @@ class ImportLockDialogView : public views::DialogDelegateView { virtual void Layout() OVERRIDE; // views::DialogDelegate: - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsModal() const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; virtual bool Accept() OVERRIDE; diff --git a/chrome/browser/ui/views/importer/import_progress_dialog_view.cc b/chrome/browser/ui/views/importer/import_progress_dialog_view.cc index e4ff5a1..62a4625 100644 --- a/chrome/browser/ui/views/importer/import_progress_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_progress_dialog_view.cc @@ -114,11 +114,10 @@ int ImportProgressDialogView::GetDialogButtons() const { return MessageBoxFlags::DIALOGBUTTON_CANCEL; } -std::wstring ImportProgressDialogView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { +string16 ImportProgressDialogView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { DCHECK(button == MessageBoxFlags::DIALOGBUTTON_CANCEL); - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_CANCEL)); + return l10n_util::GetStringUTF16(IDS_IMPORT_PROGRESS_STATUS_CANCEL); } bool ImportProgressDialogView::IsModal() const { diff --git a/chrome/browser/ui/views/importer/import_progress_dialog_view.h b/chrome/browser/ui/views/importer/import_progress_dialog_view.h index 59a780b..1afcd16 100644 --- a/chrome/browser/ui/views/importer/import_progress_dialog_view.h +++ b/chrome/browser/ui/views/importer/import_progress_dialog_view.h @@ -46,8 +46,8 @@ class ImportProgressDialogView : public views::DialogDelegateView, // views::DialogDelegate: virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual bool IsModal() const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/ui/views/js_modal_dialog_views.cc b/chrome/browser/ui/views/js_modal_dialog_views.cc index d933fe8..9124b80 100644 --- a/chrome/browser/ui/views/js_modal_dialog_views.cc +++ b/chrome/browser/ui/views/js_modal_dialog_views.cc @@ -126,15 +126,15 @@ const views::Widget* JSModalDialogViews::GetWidget() const { return message_box_view_->GetWidget(); } -std::wstring JSModalDialogViews::GetDialogButtonLabel( +string16 JSModalDialogViews::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { if (parent_->is_before_unload_dialog()) { if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) { - return UTF16ToWide(l10n_util::GetStringUTF16( - IDS_BEFOREUNLOAD_MESSAGEBOX_OK_BUTTON_LABEL)); + return l10n_util::GetStringUTF16( + IDS_BEFOREUNLOAD_MESSAGEBOX_OK_BUTTON_LABEL); } else if (button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) { - return UTF16ToWide(l10n_util::GetStringUTF16( - IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL)); + return l10n_util::GetStringUTF16( + IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL); } } return DialogDelegate::GetDialogButtonLabel(button); diff --git a/chrome/browser/ui/views/js_modal_dialog_views.h b/chrome/browser/ui/views/js_modal_dialog_views.h index 789f136..847ecbb 100644 --- a/chrome/browser/ui/views/js_modal_dialog_views.h +++ b/chrome/browser/ui/views/js_modal_dialog_views.h @@ -40,7 +40,7 @@ class JSModalDialogViews : public NativeAppModalDialog, virtual void DeleteDelegate() OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; - virtual std::wstring GetDialogButtonLabel( + virtual string16 GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const OVERRIDE; // Overridden from views::WidgetDelegate: diff --git a/chrome/browser/ui/views/repost_form_warning_view.cc b/chrome/browser/ui/views/repost_form_warning_view.cc index ce48ddf..5872184 100644 --- a/chrome/browser/ui/views/repost_form_warning_view.cc +++ b/chrome/browser/ui/views/repost_form_warning_view.cc @@ -54,13 +54,13 @@ string16 RepostFormWarningView::GetWindowTitle() const { return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_TITLE); } -std::wstring RepostFormWarningView::GetDialogButtonLabel( +string16 RepostFormWarningView::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_RESEND)); + return l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_RESEND); if (button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CANCEL)); - return std::wstring(); + return l10n_util::GetStringUTF16(IDS_CANCEL); + return string16(); } views::View* RepostFormWarningView::GetContentsView() { diff --git a/chrome/browser/ui/views/repost_form_warning_view.h b/chrome/browser/ui/views/repost_form_warning_view.h index ed1de4b..82f1d21 100644 --- a/chrome/browser/ui/views/repost_form_warning_view.h +++ b/chrome/browser/ui/views/repost_form_warning_view.h @@ -31,8 +31,8 @@ class RepostFormWarningView : public views::DialogDelegate { // views::DialogDelegate Methods: virtual string16 GetWindowTitle() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/ui/views/restart_message_box.cc b/chrome/browser/ui/views/restart_message_box.cc index b2b27eef..09070f9 100644 --- a/chrome/browser/ui/views/restart_message_box.cc +++ b/chrome/browser/ui/views/restart_message_box.cc @@ -25,10 +25,10 @@ int RestartMessageBox::GetDialogButtons() const { return ui::MessageBoxFlags::DIALOGBUTTON_OK; } -std::wstring RestartMessageBox::GetDialogButtonLabel( +string16 RestartMessageBox::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { DCHECK(button == ui::MessageBoxFlags::DIALOGBUTTON_OK); - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_OK)); + return l10n_util::GetStringUTF16(IDS_OK); } string16 RestartMessageBox::GetWindowTitle() const { diff --git a/chrome/browser/ui/views/restart_message_box.h b/chrome/browser/ui/views/restart_message_box.h index 3b08326..68dccce 100644 --- a/chrome/browser/ui/views/restart_message_box.h +++ b/chrome/browser/ui/views/restart_message_box.h @@ -24,8 +24,8 @@ class RestartMessageBox : public views::DialogDelegate { protected: // views::DialogDelegate: virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; // views::WidgetDelegate: diff --git a/chrome/browser/ui/views/simple_message_box_views.cc b/chrome/browser/ui/views/simple_message_box_views.cc index f8e3076..f49f688 100644 --- a/chrome/browser/ui/views/simple_message_box_views.cc +++ b/chrome/browser/ui/views/simple_message_box_views.cc @@ -91,11 +91,11 @@ int SimpleMessageBoxViews::GetDialogButtons() const { ? ui::MessageBoxFlags::DIALOGBUTTON_CANCEL : 0); } -std::wstring SimpleMessageBoxViews::GetDialogButtonLabel( +string16 SimpleMessageBoxViews::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { return button == ui::MessageBoxFlags::DIALOGBUTTON_OK ? - UTF16ToWide(l10n_util::GetStringUTF16(IDS_OK)) : - UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLOSE)); + l10n_util::GetStringUTF16(IDS_OK) : + l10n_util::GetStringUTF16(IDS_CLOSE); } bool SimpleMessageBoxViews::ShouldShowWindowTitle() const { diff --git a/chrome/browser/ui/views/simple_message_box_views.h b/chrome/browser/ui/views/simple_message_box_views.h index 37c8ace..fc17f61 100644 --- a/chrome/browser/ui/views/simple_message_box_views.h +++ b/chrome/browser/ui/views/simple_message_box_views.h @@ -50,8 +50,8 @@ class SimpleMessageBoxViews : public views::DialogDelegate, protected: // Overridden from views::DialogDelegate: virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; // Overridden from views::WidgetDelegate: virtual bool ShouldShowWindowTitle() const OVERRIDE; diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index c83440e..decc136 100644 --- a/chrome/browser/ui/views/uninstall_view.cc +++ b/chrome/browser/ui/views/uninstall_view.cc @@ -116,14 +116,13 @@ bool UninstallView::Cancel() { return true; } -std::wstring UninstallView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { +string16 UninstallView::GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const { // We only want to give custom name to OK button - 'Uninstall'. Cancel // button remains same. - std::wstring label = L""; - if (button == MessageBoxFlags::DIALOGBUTTON_OK) - label = UTF16ToWide(l10n_util::GetStringUTF16(IDS_UNINSTALL_BUTTON_TEXT)); - return label; + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) + return l10n_util::GetStringUTF16(IDS_UNINSTALL_BUTTON_TEXT); + return string16(); } void UninstallView::ButtonPressed( diff --git a/chrome/browser/ui/views/uninstall_view.h b/chrome/browser/ui/views/uninstall_view.h index eeead81..d167dab 100644 --- a/chrome/browser/ui/views/uninstall_view.h +++ b/chrome/browser/ui/views/uninstall_view.h @@ -35,8 +35,8 @@ class UninstallView : public views::ButtonListener, // Overridden from views::DialogDelegateView: virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; // Overridden from views::WidgetDelegate: virtual string16 GetWindowTitle() const OVERRIDE; diff --git a/chrome/browser/ui/views/update_recommended_message_box.cc b/chrome/browser/ui/views/update_recommended_message_box.cc index 5b60389..e41f1b0 100644 --- a/chrome/browser/ui/views/update_recommended_message_box.cc +++ b/chrome/browser/ui/views/update_recommended_message_box.cc @@ -44,13 +44,13 @@ int UpdateRecommendedMessageBox::GetDialogButtons() const { ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; } -std::wstring UpdateRecommendedMessageBox::GetDialogButtonLabel( +string16 UpdateRecommendedMessageBox::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { DCHECK(button == ui::MessageBoxFlags::DIALOGBUTTON_OK || button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL); return button == ui::MessageBoxFlags::DIALOGBUTTON_OK ? - UTF16ToWide(l10n_util::GetStringUTF16(IDS_RELAUNCH_AND_UPDATE)) : - UTF16ToWide(l10n_util::GetStringUTF16(IDS_NOT_NOW)); + l10n_util::GetStringUTF16(IDS_RELAUNCH_AND_UPDATE) : + l10n_util::GetStringUTF16(IDS_NOT_NOW); } bool UpdateRecommendedMessageBox::ShouldShowWindowTitle() const { diff --git a/chrome/browser/ui/views/update_recommended_message_box.h b/chrome/browser/ui/views/update_recommended_message_box.h index 371323b..d548a20 100644 --- a/chrome/browser/ui/views/update_recommended_message_box.h +++ b/chrome/browser/ui/views/update_recommended_message_box.h @@ -27,8 +27,8 @@ class UpdateRecommendedMessageBox : public views::DialogDelegate { protected: // Overridden from views::DialogDelegate: virtual int GetDialogButtons() const OVERRIDE; - virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const OVERRIDE; + virtual string16 GetDialogButtonLabel( + ui::MessageBoxFlags::DialogButton button) const OVERRIDE; // Overridden from views::WidgetDelegate: virtual bool ShouldShowWindowTitle() const OVERRIDE; diff --git a/chrome/browser/ui/views/user_data_dir_dialog.cc b/chrome/browser/ui/views/user_data_dir_dialog.cc index 891635b..2996de9 100644 --- a/chrome/browser/ui/views/user_data_dir_dialog.cc +++ b/chrome/browser/ui/views/user_data_dir_dialog.cc @@ -40,21 +40,19 @@ UserDataDirDialog::~UserDataDirDialog() { select_file_dialog_->ListenerDestroyed(); } -std::wstring UserDataDirDialog::GetDialogButtonLabel( +string16 UserDataDirDialog::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { - switch (button) { case ui::MessageBoxFlags::DIALOGBUTTON_OK: - return UTF16ToWide(l10n_util::GetStringUTF16( - IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON)); + return l10n_util::GetStringUTF16( + IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON); case ui::MessageBoxFlags::DIALOGBUTTON_CANCEL: - return UTF16ToWide(l10n_util::GetStringUTF16( - IDS_CANT_WRITE_USER_DIRECTORY_EXIT_BUTTON)); + return l10n_util::GetStringUTF16( + IDS_CANT_WRITE_USER_DIRECTORY_EXIT_BUTTON); default: NOTREACHED(); } - - return std::wstring(); + return string16(); } string16 UserDataDirDialog::GetWindowTitle() const { diff --git a/chrome/browser/ui/views/user_data_dir_dialog.h b/chrome/browser/ui/views/user_data_dir_dialog.h index b51d1ab..75b3509 100644 --- a/chrome/browser/ui/views/user_data_dir_dialog.h +++ b/chrome/browser/ui/views/user_data_dir_dialog.h @@ -34,7 +34,7 @@ class UserDataDirDialog : public views::DialogDelegate, FilePath user_data_dir() const { return user_data_dir_; } // views::DialogDelegate methods: - virtual std::wstring GetDialogButtonLabel( + virtual string16 GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; |