diff options
39 files changed, 152 insertions, 162 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; diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc index a3bdb63..5569df0 100644 --- a/views/window/dialog_client_view.cc +++ b/views/window/dialog_client_view.cc @@ -45,9 +45,9 @@ namespace { void UpdateButtonHelper(NativeTextButton* button_view, DialogDelegate* delegate, MessageBoxFlags::DialogButton button) { - std::wstring label = delegate->GetDialogButtonLabel(button); + string16 label = delegate->GetDialogButtonLabel(button); if (!label.empty()) - button_view->SetText(label); + button_view->SetText(UTF16ToWideHack(label)); button_view->SetEnabled(delegate->IsDialogButtonEnabled(button)); button_view->SetVisible(delegate->IsDialogButtonVisible(button)); } @@ -130,14 +130,14 @@ void DialogClientView::ShowDialogButtons() { DialogDelegate* dd = GetDialogDelegate(); int buttons = dd->GetDialogButtons(); if (buttons & MessageBoxFlags::DIALOGBUTTON_OK && !ok_button_) { - std::wstring label = - dd->GetDialogButtonLabel(MessageBoxFlags::DIALOGBUTTON_OK); + string16 label = dd->GetDialogButtonLabel(MessageBoxFlags::DIALOGBUTTON_OK); if (label.empty()) - label = UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_OK)); + label = l10n_util::GetStringUTF16(IDS_APP_OK); bool is_default_button = (dd->GetDefaultDialogButton() & MessageBoxFlags::DIALOGBUTTON_OK) != 0; ok_button_ = new DialogButton(this, GetWidget(), - MessageBoxFlags::DIALOGBUTTON_OK, label, + MessageBoxFlags::DIALOGBUTTON_OK, + UTF16ToWideHack(label), is_default_button); ok_button_->SetGroup(kButtonGroup); if (is_default_button) @@ -148,13 +148,13 @@ void DialogClientView::ShowDialogButtons() { AddChildView(ok_button_); } if (buttons & MessageBoxFlags::DIALOGBUTTON_CANCEL && !cancel_button_) { - std::wstring label = + string16 label = dd->GetDialogButtonLabel(MessageBoxFlags::DIALOGBUTTON_CANCEL); if (label.empty()) { if (buttons & MessageBoxFlags::DIALOGBUTTON_OK) { - label = UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_CANCEL)); + label = l10n_util::GetStringUTF16(IDS_APP_CANCEL); } else { - label = UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_CLOSE)); + label = l10n_util::GetStringUTF16(IDS_APP_CLOSE); } } bool is_default_button = @@ -162,7 +162,8 @@ void DialogClientView::ShowDialogButtons() { != 0; cancel_button_ = new DialogButton(this, GetWidget(), MessageBoxFlags::DIALOGBUTTON_CANCEL, - label, is_default_button); + UTF16ToWideHack(label), + is_default_button); cancel_button_->SetGroup(kButtonGroup); cancel_button_->AddAccelerator(Accelerator(ui::VKEY_ESCAPE, false, false, false)); @@ -463,10 +464,9 @@ void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) { int DialogClientView::GetButtonWidth(int button) const { DialogDelegate* dd = GetDialogDelegate(); - std::wstring button_label = dd->GetDialogButtonLabel( + string16 button_label = dd->GetDialogButtonLabel( static_cast<MessageBoxFlags::DialogButton>(button)); - int string_width = dialog_button_font_->GetStringWidth( - WideToUTF16Hack(button_label)); + int string_width = dialog_button_font_->GetStringWidth(button_label); return std::max(string_width + kDialogButtonLabelSpacing, kDialogMinButtonWidth); } diff --git a/views/window/dialog_delegate.cc b/views/window/dialog_delegate.cc index 0d8f680..8f1917b 100644 --- a/views/window/dialog_delegate.cc +++ b/views/window/dialog_delegate.cc @@ -25,12 +25,12 @@ bool DialogDelegate::AreAcceleratorsEnabled( return true; } -std::wstring DialogDelegate::GetDialogButtonLabel( +string16 DialogDelegate::GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const { - // empty string results in defaults for - // ui::MessageBoxFlags::DIALOGBUTTON_OK, + // Empty string results in defaults for + // ui::MessageBoxFlags::DIALOGBUTTON_OK // ui::MessageBoxFlags::DIALOGBUTTON_CANCEL. - return L""; + return string16(); } View* DialogDelegate::GetExtraView() { diff --git a/views/window/dialog_delegate.h b/views/window/dialog_delegate.h index 23b835a..79c0e20 100644 --- a/views/window/dialog_delegate.h +++ b/views/window/dialog_delegate.h @@ -6,6 +6,7 @@ #define VIEWS_WINDOW_DIALOG_DELEGATE_H_ #pragma once +#include "base/string16.h" #include "ui/base/accessibility/accessibility_types.h" #include "ui/base/message_box_flags.h" #include "views/widget/widget_delegate.h" @@ -47,7 +48,7 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { ui::MessageBoxFlags::DialogButton button); // Returns the label of the specified DialogButton. - virtual std::wstring GetDialogButtonLabel( + virtual string16 GetDialogButtonLabel( ui::MessageBoxFlags::DialogButton button) const; // Override this function if with a view which will be shown in the same |