diff options
Diffstat (limited to 'content/browser')
7 files changed, 12 insertions, 13 deletions
diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc index e370fe4..add827a 100644 --- a/content/browser/renderer_host/render_widget_host.cc +++ b/content/browser/renderer_host/render_widget_host.cc @@ -854,7 +854,7 @@ void RenderWidgetHost::OnMsgSetTooltipText( } } if (view()) - view()->SetTooltipText(UTF16ToWide(wrapped_tooltip_text)); + view()->SetTooltipText(wrapped_tooltip_text); } void RenderWidgetHost::OnMsgRequestMove(const gfx::Rect& pos) { diff --git a/content/browser/renderer_host/render_widget_host_view.h b/content/browser/renderer_host/render_widget_host_view.h index 08b500f..8fa8448 100644 --- a/content/browser/renderer_host/render_widget_host_view.h +++ b/content/browser/renderer_host/render_widget_host_view.h @@ -181,7 +181,7 @@ class RenderWidgetHostView { // Tells the View that the tooltip text for the current mouse position over // the page has changed. - virtual void SetTooltipText(const std::wstring& tooltip_text) = 0; + virtual void SetTooltipText(const string16& tooltip_text) = 0; // Notifies the View that the renderer text selection has changed. |start| // and |end| are the visual end points of the selection in the coordinate diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc index 4c535f63..d258aac 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -819,7 +819,7 @@ void RenderWidgetHostViewGtk::Destroy() { MessageLoop::current()->DeleteSoon(FROM_HERE, this); } -void RenderWidgetHostViewGtk::SetTooltipText(const std::wstring& tooltip_text) { +void RenderWidgetHostViewGtk::SetTooltipText(const string16& tooltip_text) { // Maximum number of characters we allow in a tooltip. const int kMaxTooltipLength = 8 << 10; // Clamp the tooltip length to kMaxTooltipLength so that we don't @@ -827,8 +827,7 @@ void RenderWidgetHostViewGtk::SetTooltipText(const std::wstring& tooltip_text) { // this itself). // I filed https://bugzilla.gnome.org/show_bug.cgi?id=604641 upstream. const string16 clamped_tooltip = - ui::TruncateString(WideToUTF16Hack(tooltip_text), - kMaxTooltipLength); + ui::TruncateString(tooltip_text, kMaxTooltipLength); if (clamped_tooltip.empty()) { gtk_widget_set_has_tooltip(view_.get(), FALSE); @@ -836,7 +835,7 @@ void RenderWidgetHostViewGtk::SetTooltipText(const std::wstring& tooltip_text) { gtk_widget_set_tooltip_text(view_.get(), UTF16ToUTF8(clamped_tooltip).c_str()); #if defined(OS_CHROMEOS) - tooltip_window_->SetTooltipText(UTF16ToWideHack(clamped_tooltip)); + tooltip_window_->SetTooltipText(clamped_tooltip); #endif // defined(OS_CHROMEOS) } } diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.h b/content/browser/renderer_host/render_widget_host_view_gtk.h index 43973f7..5eb9ed4 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.h +++ b/content/browser/renderer_host/render_widget_host_view_gtk.h @@ -84,7 +84,7 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView, int error_code) OVERRIDE; virtual void Destroy() OVERRIDE; virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) {} - virtual void SetTooltipText(const std::wstring& tooltip_text) OVERRIDE; + virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; virtual void SelectionChanged(const std::string& text, const ui::Range& range, const gfx::Point& start, diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index 5003006..f9da032 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -727,11 +727,11 @@ void RenderWidgetHostViewWin::Destroy() { DestroyWindow(); } -void RenderWidgetHostViewWin::SetTooltipText(const std::wstring& tooltip_text) { +void RenderWidgetHostViewWin::SetTooltipText(const string16& tooltip_text) { // Clamp the tooltip length to kMaxTooltipLength so that we don't // accidentally DOS the user with a mega tooltip (since Windows doesn't seem // to do this itself). - const std::wstring& new_tooltip_text = + const string16 new_tooltip_text = ui::TruncateString(tooltip_text, kMaxTooltipLength); if (new_tooltip_text != tooltip_text_) { @@ -1096,7 +1096,7 @@ LRESULT RenderWidgetHostViewWin::OnNotify(int w_param, NMHDR* header) { case TTN_GETDISPINFO: { NMTTDISPINFOW* tooltip_info = reinterpret_cast<NMTTDISPINFOW*>(header); tooltip_info->szText[0] = L'\0'; - tooltip_info->lpszText = const_cast<wchar_t*>(tooltip_text_.c_str()); + tooltip_info->lpszText = const_cast<WCHAR*>(tooltip_text_.c_str()); ::SendMessage( tooltip_hwnd_, TTM_SETMAXTIPWIDTH, 0, kTooltipMaxWidthPixels); SetMsgHandled(TRUE); diff --git a/content/browser/renderer_host/render_widget_host_view_win.h b/content/browser/renderer_host/render_widget_host_view_win.h index a1656a6..d2047f3 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.h +++ b/content/browser/renderer_host/render_widget_host_view_win.h @@ -164,7 +164,7 @@ class RenderWidgetHostViewWin // called by TabContents before DestroyWindow virtual void WillWmDestroy() OVERRIDE; virtual void Destroy() OVERRIDE; - virtual void SetTooltipText(const std::wstring& tooltip_text) OVERRIDE; + virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; virtual void SetBackground(const SkBitmap& background) OVERRIDE; virtual void SetVisuallyDeemphasized(const SkColor* color, @@ -341,7 +341,7 @@ class RenderWidgetHostViewWin // Tooltips // The text to be shown in the tooltip, supplied by the renderer. - std::wstring tooltip_text_; + string16 tooltip_text_; // The tooltip control hwnd HWND tooltip_hwnd_; // Whether or not a tooltip is currently visible. We use this to track diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h index 8c66291..3fdcee1 100644 --- a/content/browser/renderer_host/test_render_view_host.h +++ b/content/browser/renderer_host/test_render_view_host.h @@ -87,7 +87,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { int error_code) OVERRIDE; virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) { } virtual void Destroy() OVERRIDE {} - virtual void SetTooltipText(const std::wstring& tooltip_text) OVERRIDE {} + virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE {} virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; #if defined(OS_MACOSX) virtual void SetTakesFocusOnlyOnMouseDown(bool flag) OVERRIDE {} |