diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-25 04:31:11 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-25 04:31:11 +0000 |
commit | 07f95333a47323bfbd65c8443e0fcc470956cb27 (patch) | |
tree | 9b49d3de4d7f454b03c59ba11ae33e09d2d06621 /chrome/renderer/render_widget.cc | |
parent | 039169f20b03406981e7417761f62dde08eb23ab (diff) | |
download | chromium_src-07f95333a47323bfbd65c8443e0fcc470956cb27.zip chromium_src-07f95333a47323bfbd65c8443e0fcc470956cb27.tar.gz chromium_src-07f95333a47323bfbd65c8443e0fcc470956cb27.tar.bz2 |
A tricky fix for Issue 1845 (Take 2).
This is almost the same change as <http://codereview.chromium.org/39252/show>, which caused a build break on a Linux buildbot while compiling my new template function in "chrome/common/render_messages.h".
Even though I was not able to reproduce the build errors on my Linux box, I removed this function and use the int type in my IPC message 'ViewMsg_SetTextDirection'.
BUG=1845
Review URL: http://codereview.chromium.org/42495
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.cc')
-rw-r--r-- | chrome/renderer/render_widget.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 92d4920..b5b9942 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -21,6 +21,7 @@ #endif // defined(OS_POSIX) #include "webkit/glue/webinputevent.h" +#include "webkit/glue/webtextdirection.h" #include "webkit/glue/webwidget.h" RenderWidget::RenderWidget(RenderThreadBase* render_thread, bool activatable) @@ -119,6 +120,7 @@ IPC_DEFINE_MESSAGE_MAP(RenderWidget) IPC_MESSAGE_HANDLER(ViewMsg_ImeSetInputMode, OnImeSetInputMode) IPC_MESSAGE_HANDLER(ViewMsg_ImeSetComposition, OnImeSetComposition) IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnMsgRepaint) + IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP() @@ -644,6 +646,20 @@ void RenderWidget::OnMsgRepaint(const gfx::Size& size_to_paint) { DidInvalidateRect(webwidget_, repaint_rect); } +void RenderWidget::OnSetTextDirection(int direction) { + if (!webwidget_) + return; + + WebTextDirection new_direction = static_cast<WebTextDirection>(direction); + if (new_direction == WEB_TEXT_DIRECTION_DEFAULT || + new_direction == WEB_TEXT_DIRECTION_LTR || + new_direction == WEB_TEXT_DIRECTION_RTL) { + webwidget_->SetTextDirection(new_direction); + } else { + NOTREACHED(); + } +} + bool RenderWidget::next_paint_is_resize_ack() const { return ViewHostMsg_PaintRect_Flags::is_resize_ack(next_paint_flags_); } |