diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-21 20:28:23 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-21 20:28:23 +0000 |
commit | 790e2fdbb6ca0ce407b4af36584442ee3dd41243 (patch) | |
tree | 8af5bcd2d3b3a043ff0cec3e8dca5b378b014bf1 | |
parent | f6e68091282a63e3d201cd13affc54f96b5f04d3 (diff) | |
download | chromium_src-790e2fdbb6ca0ce407b4af36584442ee3dd41243.zip chromium_src-790e2fdbb6ca0ce407b4af36584442ee3dd41243.tar.gz chromium_src-790e2fdbb6ca0ce407b4af36584442ee3dd41243.tar.bz2 |
wstring: convert all SetPageTitle APIs to use string16
BUG=23581
Review URL: http://codereview.chromium.org/7915008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102157 0039d316-1c4b-4281-b951-d872f2087c98
36 files changed, 43 insertions, 44 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc index 0ae84e5..dc8fbdf 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc @@ -186,12 +186,12 @@ void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { requested_size_.width(), requested_size_.height()); } -void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { +void TabContentsViewGtk::SetPageTitle(const string16& title) { // Set the window name to include the page title so it's easier to spot // when debugging (e.g. via xwininfo -tree). gfx::NativeView content_view = GetContentNativeView(); if (content_view && content_view->window) - gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); + gdk_window_set_title(content_view->window, UTF16ToUTF8(title).c_str()); } void TabContentsViewGtk::OnTabCrashed(base::TerminationStatus status, diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/chrome/browser/tab_contents/tab_contents_view_gtk.h index b21171f..3d8d361 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.h +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.h @@ -53,7 +53,7 @@ class TabContentsViewGtk : public TabContentsView, virtual gfx::NativeView GetContentNativeView() const OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void OnTabCrashed(base::TerminationStatus status, int error_code) OVERRIDE; virtual void SizeContents(const gfx::Size& size) OVERRIDE; diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.h b/chrome/browser/tab_contents/tab_contents_view_mac.h index 37dec4a74a..c2aeadb 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.h +++ b/chrome/browser/tab_contents/tab_contents_view_mac.h @@ -65,7 +65,7 @@ class TabContentsViewMac : public TabContentsView, virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE; virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void OnTabCrashed(base::TerminationStatus status, int error_code) OVERRIDE; virtual void SizeContents(const gfx::Size& size) OVERRIDE; diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index 1c2db13..6de3858 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -173,7 +173,7 @@ void TabContentsViewMac::RenderViewCreated(RenderViewHost* host) { host->EnablePreferredSizeMode(kPreferredSizeWidth); } -void TabContentsViewMac::SetPageTitle(const std::wstring& title) { +void TabContentsViewMac::SetPageTitle(const string16& title) { // Meaningless on the Mac; widgets don't have a "title" attribute } diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view.h index 9bc4efc..905e141 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view.h +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view.h @@ -8,6 +8,7 @@ #include <string> +#include "base/string16.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" #include "ui/gfx/native_widget_types.h" @@ -40,7 +41,7 @@ class NativeTabContentsView { virtual gfx::NativeWindow GetTopLevelNativeWindow() const = 0; - virtual void SetPageTitle(const std::wstring& title) = 0; + virtual void SetPageTitle(const string16& title) = 0; virtual void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask ops, diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc index f7235b2..4bc2eef 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc @@ -67,7 +67,7 @@ gfx::NativeWindow NativeTabContentsViewAura::GetTopLevelNativeWindow() const { return NULL; } -void NativeTabContentsViewAura::SetPageTitle(const std::wstring& title) { +void NativeTabContentsViewAura::SetPageTitle(const string16& title) { // TODO(beng): NOTIMPLEMENTED(); } diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h index e570b5a..06a8f7f 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h @@ -29,7 +29,7 @@ class NativeTabContentsViewAura : public views::NativeWidgetAura, virtual RenderWidgetHostView* CreateRenderWidgetHostView( RenderWidgetHost* render_widget_host) OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask ops, const SkBitmap& image, diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc index ee2f37f..9c38d92 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc @@ -146,11 +146,11 @@ gfx::NativeWindow NativeTabContentsViewGtk::GetTopLevelNativeWindow() const { return window ? GTK_WINDOW(window) : NULL; } -void NativeTabContentsViewGtk::SetPageTitle(const std::wstring& title) { +void NativeTabContentsViewGtk::SetPageTitle(const string16& title) { // Set the window name to include the page title so it's easier to spot // when debugging (e.g. via xwininfo -tree). if (GDK_IS_WINDOW(GetNativeView()->window)) - gdk_window_set_title(GetNativeView()->window, WideToUTF8(title).c_str()); + gdk_window_set_title(GetNativeView()->window, UTF16ToUTF8(title).c_str()); } void NativeTabContentsViewGtk::StartDragging(const WebDropData& drop_data, diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h index 384a2ea..728a629 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h @@ -34,7 +34,7 @@ class NativeTabContentsViewGtk : public views::NativeWidgetGtk, virtual RenderWidgetHostView* CreateRenderWidgetHostView( RenderWidgetHost* render_widget_host) OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask ops, const SkBitmap& image, diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc index cfa0604..e754a74 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc @@ -87,7 +87,7 @@ gfx::NativeWindow NativeTabContentsViewViews::GetTopLevelNativeWindow() const { return NULL; } -void NativeTabContentsViewViews::SetPageTitle(const std::wstring& title) { +void NativeTabContentsViewViews::SetPageTitle(const string16& title) { SetWindowTitle(title); } diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h index f7961ba..7d0c7fb 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h @@ -34,7 +34,7 @@ class NativeTabContentsViewViews : public views::NativeWidgetViews, virtual RenderWidgetHostView* CreateRenderWidgetHostView( RenderWidgetHost* render_widget_host) OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask ops, const SkBitmap& image, diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc index fecfffa..0a03028 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc @@ -129,7 +129,7 @@ gfx::NativeWindow NativeTabContentsViewWin::GetTopLevelNativeWindow() const { return ::GetAncestor(GetNativeView(), GA_ROOT); } -void NativeTabContentsViewWin::SetPageTitle(const std::wstring& title) { +void NativeTabContentsViewWin::SetPageTitle(const string16& title) { // It's possible to get this after the hwnd has been destroyed. if (GetNativeView()) ::SetWindowText(GetNativeView(), title.c_str()); diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h index 611775d..6339a9e 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h @@ -33,7 +33,7 @@ class NativeTabContentsViewWin : public views::NativeWidgetWin, virtual RenderWidgetHostView* CreateRenderWidgetHostView( RenderWidgetHost* render_widget_host) OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void StartDragging(const WebDropData& drop_data, WebKit::WebDragOperationsMask ops, const SkBitmap& image, diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc index 5b3aa34..827a37b 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc @@ -119,7 +119,7 @@ void TabContentsViewViews::StartDragging(const WebDropData& drop_data, native_tab_contents_view_->StartDragging(drop_data, ops, image, image_offset); } -void TabContentsViewViews::SetPageTitle(const std::wstring& title) { +void TabContentsViewViews::SetPageTitle(const string16& title) { native_tab_contents_view_->SetPageTitle(title); } diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h index 9d50479..acc92b0 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.h @@ -61,7 +61,7 @@ class TabContentsViewViews : public views::Widget, virtual gfx::NativeView GetContentNativeView() const OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void OnTabCrashed(base::TerminationStatus status, int error_code) OVERRIDE; virtual void SizeContents(const gfx::Size& size) OVERRIDE; diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index c3f1396..287e661 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -1377,7 +1377,7 @@ bool TabContents::UpdateTitleForEntry(NavigationEntry* entry, } // Lastly, set the title for the view. - view_->SetPageTitle(UTF16ToWideHack(final_title)); + view_->SetPageTitle(final_title); TitleUpdatedDetails details(entry, explicit_set); diff --git a/content/browser/tab_contents/tab_contents_view.h b/content/browser/tab_contents/tab_contents_view.h index 8134ac5..05da7c6 100644 --- a/content/browser/tab_contents/tab_contents_view.h +++ b/content/browser/tab_contents/tab_contents_view.h @@ -64,7 +64,7 @@ class CONTENT_EXPORT TabContentsView : public RenderViewHostDelegate::View { // is not strictly necessary and isn't expected to be displayed anywhere, but // can aid certain debugging tools such as Spy++ on Windows where you are // trying to find a specific window. - virtual void SetPageTitle(const std::wstring& title) = 0; + virtual void SetPageTitle(const string16& title) = 0; // Used to notify the view that a tab has crashed so each platform can // prepare the sad tab. diff --git a/content/test/test_tab_contents_view.cc b/content/test/test_tab_contents_view.cc index 70bbba2..216e163 100644 --- a/content/test/test_tab_contents_view.cc +++ b/content/test/test_tab_contents_view.cc @@ -85,7 +85,7 @@ gfx::NativeWindow TestTabContentsView::GetTopLevelNativeWindow() const { void TestTabContentsView::GetContainerBounds(gfx::Rect *out) const { } -void TestTabContentsView::SetPageTitle(const std::wstring& title) { +void TestTabContentsView::SetPageTitle(const string16& title) { } void TestTabContentsView::OnTabCrashed(base::TerminationStatus status, diff --git a/content/test/test_tab_contents_view.h b/content/test/test_tab_contents_view.h index 92d64b9..90af73c 100644 --- a/content/test/test_tab_contents_view.h +++ b/content/test/test_tab_contents_view.h @@ -51,7 +51,7 @@ class TestTabContentsView : public TabContentsView { virtual gfx::NativeView GetContentNativeView() const OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; virtual void GetContainerBounds(gfx::Rect *out) const OVERRIDE; - virtual void SetPageTitle(const std::wstring& title) OVERRIDE; + virtual void SetPageTitle(const string16& title) OVERRIDE; virtual void OnTabCrashed(base::TerminationStatus status, int error_code) OVERRIDE; virtual void SizeContents(const gfx::Size& size) OVERRIDE; diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc index e15e78c7..43e39d5 100644 --- a/views/widget/native_widget_aura.cc +++ b/views/widget/native_widget_aura.cc @@ -175,7 +175,7 @@ void NativeWidgetAura::GetWindowPlacement( NOTIMPLEMENTED(); } -void NativeWidgetAura::SetWindowTitle(const std::wstring& title) { +void NativeWidgetAura::SetWindowTitle(const string16& title) { NOTIMPLEMENTED(); } diff --git a/views/widget/native_widget_aura.h b/views/widget/native_widget_aura.h index 8c6975e..bf4c84a 100644 --- a/views/widget/native_widget_aura.h +++ b/views/widget/native_widget_aura.h @@ -61,7 +61,7 @@ class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, virtual void GetWindowPlacement( gfx::Rect* bounds, ui::WindowShowState* maximized) const OVERRIDE; - virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; + virtual void SetWindowTitle(const string16& title) OVERRIDE; virtual void SetWindowIcons(const SkBitmap& window_icon, const SkBitmap& app_icon) OVERRIDE; virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc index 6a7973c..6890c9c 100644 --- a/views/widget/native_widget_gtk.cc +++ b/views/widget/native_widget_gtk.cc @@ -1008,7 +1008,7 @@ void NativeWidgetGtk::GetWindowPlacement( // Do nothing for now. ChromeOS isn't yet saving window placement. } -void NativeWidgetGtk::SetWindowTitle(const std::wstring& title) { +void NativeWidgetGtk::SetWindowTitle(const string16& title) { // We don't have a window title on ChromeOS (right now). } diff --git a/views/widget/native_widget_gtk.h b/views/widget/native_widget_gtk.h index 152d462..49718aa 100644 --- a/views/widget/native_widget_gtk.h +++ b/views/widget/native_widget_gtk.h @@ -171,7 +171,7 @@ class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate, virtual void GetWindowPlacement( gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; - virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; + virtual void SetWindowTitle(const string16& title) OVERRIDE; virtual void SetWindowIcons(const SkBitmap& window_icon, const SkBitmap& app_icon) OVERRIDE; virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; diff --git a/views/widget/native_widget_private.h b/views/widget/native_widget_private.h index 63471d4..9f0128b 100644 --- a/views/widget/native_widget_private.h +++ b/views/widget/native_widget_private.h @@ -143,7 +143,7 @@ class VIEWS_EXPORT NativeWidgetPrivate : public NativeWidget, ui::WindowShowState* show_state) const = 0; // Sets the NativeWindow title. - virtual void SetWindowTitle(const std::wstring& title) = 0; + virtual void SetWindowTitle(const string16& title) = 0; // Sets the Window icons. |window_icon| is a 16x16 icon suitable for use in // a title bar. |app_icon| is a larger size for use in the host environment diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc index 65dfac4..bd0e56f 100644 --- a/views/widget/native_widget_views.cc +++ b/views/widget/native_widget_views.cc @@ -281,7 +281,7 @@ void NativeWidgetViews::GetWindowPlacement( *show_state = ui::SHOW_STATE_NORMAL; } -void NativeWidgetViews::SetWindowTitle(const std::wstring& title) { +void NativeWidgetViews::SetWindowTitle(const string16& title) { } void NativeWidgetViews::SetWindowIcons(const SkBitmap& window_icon, diff --git a/views/widget/native_widget_views.h b/views/widget/native_widget_views.h index 3c43a57..3a0d004 100644 --- a/views/widget/native_widget_views.h +++ b/views/widget/native_widget_views.h @@ -86,7 +86,7 @@ class VIEWS_EXPORT NativeWidgetViews : public internal::NativeWidgetPrivate { virtual void GetWindowPlacement( gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; - virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; + virtual void SetWindowTitle(const string16& title) OVERRIDE; virtual void SetWindowIcons(const SkBitmap& window_icon, const SkBitmap& app_icon) OVERRIDE; virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; diff --git a/views/widget/native_widget_wayland.cc b/views/widget/native_widget_wayland.cc index 2c9b67d..5e07752 100644 --- a/views/widget/native_widget_wayland.cc +++ b/views/widget/native_widget_wayland.cc @@ -251,7 +251,7 @@ void NativeWidgetWayland::GetWindowPlacement( NOTIMPLEMENTED(); } -void NativeWidgetWayland::SetWindowTitle(const std::wstring& title) { +void NativeWidgetWayland::SetWindowTitle(const string16& title) { } void NativeWidgetWayland::SetWindowIcons(const SkBitmap& window_icon, diff --git a/views/widget/native_widget_wayland.h b/views/widget/native_widget_wayland.h index f5bfa45..591e988 100644 --- a/views/widget/native_widget_wayland.h +++ b/views/widget/native_widget_wayland.h @@ -77,7 +77,7 @@ class NativeWidgetWayland : public internal::NativeWidgetPrivate, virtual void GetWindowPlacement( gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; - virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; + virtual void SetWindowTitle(const string16& title) OVERRIDE; virtual void SetWindowIcons(const SkBitmap& window_icon, const SkBitmap& app_icon) OVERRIDE; virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc index 1a085f0..f94c3bf 100644 --- a/views/widget/native_widget_win.cc +++ b/views/widget/native_widget_win.cc @@ -688,7 +688,7 @@ void NativeWidgetWin::GetWindowPlacement( } } -void NativeWidgetWin::SetWindowTitle(const std::wstring& title) { +void NativeWidgetWin::SetWindowTitle(const string16& title) { SetWindowText(GetNativeView(), title.c_str()); SetAccessibleName(title); } diff --git a/views/widget/native_widget_win.h b/views/widget/native_widget_win.h index 74ab88e..a376bf4 100644 --- a/views/widget/native_widget_win.h +++ b/views/widget/native_widget_win.h @@ -217,7 +217,7 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl, virtual void GetWindowPlacement( gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; - virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; + virtual void SetWindowTitle(const string16& title) OVERRIDE; virtual void SetWindowIcons(const SkBitmap& window_icon, const SkBitmap& app_icon) OVERRIDE; virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; diff --git a/views/widget/widget.cc b/views/widget/widget.cc index a02d9f2..c9a0f06 100644 --- a/views/widget/widget.cc +++ b/views/widget/widget.cc @@ -675,7 +675,7 @@ void Widget::UpdateWindowTitle() { window_title = WideToUTF16(widget_delegate_->GetWindowTitle()); } base::i18n::AdjustStringForLocaleDirection(&window_title); - native_widget_->SetWindowTitle(UTF16ToWide(window_title)); + native_widget_->SetWindowTitle(window_title); } void Widget::UpdateWindowIcon() { diff --git a/webkit/tools/test_shell/mac/test_webview_delegate.mm b/webkit/tools/test_shell/mac/test_webview_delegate.mm index 239a56f..e0beb0b 100644 --- a/webkit/tools/test_shell/mac/test_webview_delegate.mm +++ b/webkit/tools/test_shell/mac/test_webview_delegate.mm @@ -216,9 +216,9 @@ void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { [alert runModal]; } -void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { +void TestWebViewDelegate::SetPageTitle(const string16& title) { [[shell_->webViewHost()->view_handle() window] - setTitle:[NSString stringWithUTF8String:WideToUTF8(title).c_str()]]; + setTitle:[NSString stringWithUTF8String:UTF16ToUTF8(title).c_str()]]; } void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 5dee3f4..a427cd3 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -836,9 +836,7 @@ void TestWebViewDelegate::didClearWindowObject(WebFrame* frame) { void TestWebViewDelegate::didReceiveTitle( WebFrame* frame, const WebString& title, WebTextDirection direction) { - std::wstring wtitle = UTF16ToWideHack(title); - - SetPageTitle(wtitle); + SetPageTitle(title); } void TestWebViewDelegate::didFinishDocumentLoad(WebFrame* frame) { diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 9817088..3ae8ec6 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -334,7 +334,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, // Called the title of the page changes. // Can be used to update the title of the window. - void SetPageTitle(const std::wstring& title); + void SetPageTitle(const string16& title); // Called when the URL of the page changes. // Extracts the URL and forwards on to SetAddressBarURL(). diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index 71fe60e..ab60381 100644 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -260,9 +260,9 @@ void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { gtk_widget_destroy(dialog); } -void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { +void TestWebViewDelegate::SetPageTitle(const string16& title) { gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), - ("Test Shell - " + WideToUTF8(title)).c_str()); + ("Test Shell - " + UTF16ToUTF8(title)).c_str()); } void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { diff --git a/webkit/tools/test_shell/test_webview_delegate_win.cc b/webkit/tools/test_shell/test_webview_delegate_win.cc index b8c7522..b8a0ecb 100644 --- a/webkit/tools/test_shell/test_webview_delegate_win.cc +++ b/webkit/tools/test_shell/test_webview_delegate_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -196,7 +196,7 @@ void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { MessageBox(NULL, message.c_str(), L"JavaScript Alert", MB_OK); } -void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { +void TestWebViewDelegate::SetPageTitle(const string16& title) { // The Windows test shell, pre-refactoring, ignored this. *shrug* } |