diff options
author | yosin@chromium.org <yosin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-28 08:12:42 +0000 |
---|---|---|
committer | yosin@chromium.org <yosin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-28 08:12:42 +0000 |
commit | 09e14d69cad45e0a11720793ad110545592f85ae (patch) | |
tree | 22c11a51cef32b725d1c6b3097d90e9c50413e8b /chrome/browser/chromeos | |
parent | 1cf92d0f4fdd32481a23b3813ccaab2bd8221f39 (diff) | |
download | chromium_src-09e14d69cad45e0a11720793ad110545592f85ae.zip chromium_src-09e14d69cad45e0a11720793ad110545592f85ae.tar.gz chromium_src-09e14d69cad45e0a11720793ad110545592f85ae.tar.bz2 |
Change std::wstring to string16 on WidgetDelegate::GetWindowTitle.
BUG=68267
TEST=No visible changes
Review URL: http://codereview.chromium.org/7972009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
11 files changed, 56 insertions, 46 deletions
diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc index 6d29e75..40650eb 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.cc +++ b/chrome/browser/chromeos/external_protocol_dialog.cc @@ -58,8 +58,8 @@ std::wstring ExternalProtocolDialog::GetDialogButtonLabel( l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT)); } -std::wstring ExternalProtocolDialog::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_TITLE)); +string16 ExternalProtocolDialog::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_TITLE); } void ExternalProtocolDialog::DeleteDelegate() { diff --git a/chrome/browser/chromeos/external_protocol_dialog.h b/chrome/browser/chromeos/external_protocol_dialog.h index 9043caa..d726b3b 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.h +++ b/chrome/browser/chromeos/external_protocol_dialog.h @@ -6,6 +6,9 @@ #define CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_ #pragma once +#include <string> + +#include "base/string16.h" #include "base/time.h" #include "views/window/dialog_delegate.h" @@ -30,7 +33,7 @@ class ExternalProtocolDialog : public views::DialogDelegate { virtual int GetDialogButtons() const OVERRIDE; virtual std::wstring GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Accept() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/chromeos/frame/bubble_frame_view.cc b/chrome/browser/chromeos/frame/bubble_frame_view.cc index 3efca019..fd5f0ed 100644 --- a/chrome/browser/chromeos/frame/bubble_frame_view.cc +++ b/chrome/browser/chromeos/frame/bubble_frame_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/chromeos/frame/bubble_frame_view.h" +#include <algorithm> + #include "chrome/browser/chromeos/frame/bubble_window.h" #include "chrome/browser/chromeos/login/helper.h" #include "grit/theme_resources_standard.h" @@ -54,7 +56,8 @@ BubbleFrameView::BubbleFrameView(views::Widget* frame, set_border(views::Border::CreateSolidBorder(kBorderThickness, kBorderColor)); if (widget_delegate->ShouldShowWindowTitle()) { - title_ = new views::Label(widget_delegate->GetWindowTitle()); + title_ = new views::Label( + UTF16ToWideHack(widget_delegate->GetWindowTitle())); title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); title_->SetFont(title_->font().DeriveFont(kFontSizeCorrectionDelta, gfx::Font::BOLD)); @@ -93,7 +96,8 @@ void BubbleFrameView::StopThrobber() { DCHECK(throbber_ != NULL); throbber_->Stop(); if (title_) - title_->SetText(frame_->widget_delegate()->GetWindowTitle()); + title_->SetText( + UTF16ToWideHack(frame_->widget_delegate()->GetWindowTitle())); } gfx::Rect BubbleFrameView::GetBoundsForClientView() const { diff --git a/chrome/browser/chromeos/login/captcha_view.cc b/chrome/browser/chromeos/login/captcha_view.cc index 19b4e20..20f24cf 100644 --- a/chrome/browser/chromeos/login/captcha_view.cc +++ b/chrome/browser/chromeos/login/captcha_view.cc @@ -96,8 +96,8 @@ views::View* CaptchaView::GetContentsView() { return this; } -std::wstring CaptchaView::GetWindowTitle() const { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOGIN_CAPTCHA_DIALOG_TITLE)); +string16 CaptchaView::GetWindowTitle() const { + return l10n_util::GetStringUTF16(IDS_LOGIN_CAPTCHA_DIALOG_TITLE); } void CaptchaView::SetCaptchaURL(const GURL& captcha_url) { diff --git a/chrome/browser/chromeos/login/captcha_view.h b/chrome/browser/chromeos/login/captcha_view.h index 764abde..3a901ce 100644 --- a/chrome/browser/chromeos/login/captcha_view.h +++ b/chrome/browser/chromeos/login/captcha_view.h @@ -43,10 +43,10 @@ class CaptchaView : public views::DialogDelegateView, virtual ~CaptchaView() {} // views::DialogDelegate: - virtual bool Accept(); - virtual bool IsModal() const; - virtual views::View* GetContentsView(); - virtual std::wstring GetWindowTitle() const; + virtual bool Accept() OVERRIDE; + virtual bool IsModal() const OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; // views::TextfieldController: virtual void ContentsChanged(views::Textfield* sender, diff --git a/chrome/browser/chromeos/login/eula_view.cc b/chrome/browser/chromeos/login/eula_view.cc index b28640e..ba74444 100644 --- a/chrome/browser/chromeos/login/eula_view.cc +++ b/chrome/browser/chromeos/login/eula_view.cc @@ -94,17 +94,16 @@ class TpmInfoView : public views::DialogDelegateView { protected: // views::DialogDelegateView overrides: - virtual bool Accept() { return true; } - virtual bool IsModal() const { return true; } - virtual views::View* GetContentsView() { return this; } - virtual int GetDialogButtons() const { + virtual bool Accept() OVERRIDE { return true; } + virtual bool IsModal() const OVERRIDE { return true; } + virtual views::View* GetContentsView() OVERRIDE { return this; } + virtual int GetDialogButtons() const OVERRIDE { return MessageBoxFlags::DIALOGBUTTON_OK; } // views::View overrides: - virtual std::wstring GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_SECURITY_SETTING)); + virtual string16 GetWindowTitle() const OVERRIDE { + return l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_SECURITY_SETTING); } gfx::Size GetPreferredSize() { diff --git a/chrome/browser/chromeos/login/password_changed_view.cc b/chrome/browser/chromeos/login/password_changed_view.cc index f2328e2..131c3c2 100644 --- a/chrome/browser/chromeos/login/password_changed_view.cc +++ b/chrome/browser/chromeos/login/password_changed_view.cc @@ -48,7 +48,7 @@ bool PasswordChangedView::Accept() { } int PasswordChangedView::GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_OK; + return MessageBoxFlags::DIALOGBUTTON_OK; } views::View* PasswordChangedView::GetInitiallyFocusedView() { @@ -68,9 +68,9 @@ views::View* PasswordChangedView::GetContentsView() { return this; } -std::wstring PasswordChangedView::GetWindowTitle() const { - return UTF16ToWide( - l10n_util::GetStringUTF16(IDS_LOGIN_PASSWORD_CHANGED_DIALOG_BOX_TITLE)); +string16 PasswordChangedView::GetWindowTitle() const { + return l10n_util::GetStringUTF16( + IDS_LOGIN_PASSWORD_CHANGED_DIALOG_BOX_TITLE); } gfx::Size PasswordChangedView::GetPreferredSize() { @@ -171,7 +171,6 @@ void PasswordChangedView::Init() { delta_sync_radio_->SetChecked(true); old_password_field_->SetEnabled(true); } - } bool PasswordChangedView::ExitDialog() { diff --git a/chrome/browser/chromeos/login/password_changed_view.h b/chrome/browser/chromeos/login/password_changed_view.h index c0bff39..ae135cf 100644 --- a/chrome/browser/chromeos/login/password_changed_view.h +++ b/chrome/browser/chromeos/login/password_changed_view.h @@ -45,26 +45,26 @@ class PasswordChangedView : public views::DialogDelegateView, virtual ~PasswordChangedView() {} // views::DialogDelegate: - virtual bool Accept(); - virtual int GetDialogButtons() const; + virtual bool Accept() OVERRIDE; + virtual int GetDialogButtons() const OVERRIDE; // views::WidgetDelegate: - virtual View* GetInitiallyFocusedView(); - virtual bool IsModal() const; - virtual views::View* GetContentsView(); + virtual View* GetInitiallyFocusedView() OVERRIDE; + virtual bool IsModal() const OVERRIDE; + virtual views::View* GetContentsView() OVERRIDE; // views::View: - virtual std::wstring GetWindowTitle() const; + virtual string16 GetWindowTitle() const OVERRIDE; // views::ButtonListener: virtual void ButtonPressed(views::Button* sender, - const views::Event& event); + const views::Event& event) OVERRIDE; // views::TextfieldController: virtual bool HandleKeyEvent(views::Textfield* sender, - const views::KeyEvent& keystroke); + const views::KeyEvent& keystroke) OVERRIDE; virtual void ContentsChanged(views::Textfield* sender, - const string16& new_contents) {} + const string16& new_contents) OVERRIDE {} protected: // views::View: diff --git a/chrome/browser/chromeos/native_dialog_window.cc b/chrome/browser/chromeos/native_dialog_window.cc index f068649..b6ca24b 100644 --- a/chrome/browser/chromeos/native_dialog_window.cc +++ b/chrome/browser/chromeos/native_dialog_window.cc @@ -59,12 +59,13 @@ class NativeDialogHost : public views::DialogDelegateView { ~NativeDialogHost(); // views::DialogDelegate implementation: - virtual bool CanResize() const { return flags_ & DIALOG_FLAG_RESIZEABLE; } - virtual int GetDialogButtons() const { return 0; } - virtual std::wstring GetWindowTitle() const { return title_; } - virtual views::View* GetContentsView() { return this; } - virtual bool IsModal() const { return flags_ & DIALOG_FLAG_MODAL; } - virtual void WindowClosing(); + virtual bool CanResize() const OVERRIDE + { return flags_ & DIALOG_FLAG_RESIZEABLE; } + virtual int GetDialogButtons() const OVERRIDE { return 0; } + virtual string16 GetWindowTitle() const OVERRIDE { return title_; } + virtual views::View* GetContentsView() OVERRIDE { return this; } + virtual bool IsModal() const OVERRIDE { return flags_ & DIALOG_FLAG_MODAL; } + virtual void WindowClosing() OVERRIDE; protected: CHROMEGTK_CALLBACK_0(NativeDialogHost, void, OnCheckResize); @@ -72,11 +73,12 @@ class NativeDialogHost : public views::DialogDelegateView { CHROMEGTK_CALLBACK_1(NativeDialogHost, gboolean, OnGtkKeyPressed, GdkEvent*); // views::View implementation: - virtual gfx::Size GetPreferredSize(); - virtual void Layout(); + virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual void Layout() OVERRIDE; virtual void ViewHierarchyChanged(bool is_add, views::View* parent, - views::View* child); + views::View* child) OVERRIDE; + private: // Init and attach to native dialog. void Init(); @@ -93,7 +95,7 @@ class NativeDialogHost : public views::DialogDelegateView { // NativeViewHost for the dialog's contents. views::NativeViewHost* contents_view_; - std::wstring title_; + string16 title_; int flags_; gfx::Size size_; gfx::Size preferred_size_; @@ -120,7 +122,7 @@ NativeDialogHost::NativeDialogHost(gfx::NativeView native_dialog, destroy_signal_id_(0) { const char* title = gtk_window_get_title(GTK_WINDOW(dialog_)); if (title) - UTF8ToWide(title, strlen(title), &title_); + UTF8ToUTF16(title, strlen(title), &title_); destroy_signal_id_ = g_signal_connect(dialog_, "destroy", G_CALLBACK(&OnDialogDestroyThunk), this); diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc index 50034d58..bfe04b5 100644 --- a/chrome/browser/chromeos/options/network_config_view.cc +++ b/chrome/browser/chromeos/options/network_config_view.cc @@ -105,8 +105,8 @@ views::View* NetworkConfigView::GetContentsView() { return this; } -std::wstring NetworkConfigView::GetWindowTitle() const { - return UTF16ToWide(child_config_view_->GetTitle()); +string16 NetworkConfigView::GetWindowTitle() const { + return child_config_view_->GetTitle(); } void NetworkConfigView::GetAccessibleState(ui::AccessibleViewState* state) { diff --git a/chrome/browser/chromeos/options/network_config_view.h b/chrome/browser/chromeos/options/network_config_view.h index da5a427..672b83e 100644 --- a/chrome/browser/chromeos/options/network_config_view.h +++ b/chrome/browser/chromeos/options/network_config_view.h @@ -6,6 +6,9 @@ #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ #pragma once +#include <string> + +#include "base/string16.h" #include "chrome/browser/chromeos/cros/network_library.h" #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow #include "views/controls/button/button.h" // views::ButtonListener @@ -57,7 +60,7 @@ class NetworkConfigView : public views::DialogDelegateView, // views::WidgetDelegate methods. virtual bool IsModal() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; - virtual std::wstring GetWindowTitle() const OVERRIDE; + virtual string16 GetWindowTitle() const OVERRIDE; // views::View overrides. virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |