Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4528)

Unified Diff: chrome/renderer/render_widget.cc

Issue 42495: A tricky fix for Issue 1845 (Take 2).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_widget.h ('k') | webkit/glue/webtextdirection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_widget.cc
===================================================================
--- chrome/renderer/render_widget.cc (revision 12427)
+++ chrome/renderer/render_widget.cc (working copy)
@@ -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_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 @@
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_);
}
« no previous file with comments | « chrome/renderer/render_widget.h ('k') | webkit/glue/webtextdirection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698