summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webwidget.h
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 05:46:29 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 05:46:29 +0000
commit779aae5fa525671293b0db3ddad27cc3811a362a (patch)
treecc943534ce00344cfd998db989985de37a7e8927 /webkit/glue/webwidget.h
parentc285cf2c3dc3eb128541f07065974010dae1b408 (diff)
downloadchromium_src-779aae5fa525671293b0db3ddad27cc3811a362a.zip
chromium_src-779aae5fa525671293b0db3ddad27cc3811a362a.tar.gz
chromium_src-779aae5fa525671293b0db3ddad27cc3811a362a.tar.bz2
A tricky fix for Issue 1845.
This change is a very tricky fix for Issue 1845 in chromium: cant alignt text to the right using right shift and right ctrl.This change consists of two parts listed below. 1. Emulating the implementation of Safari that changes the text-direction of an input element. Safari uses context menus to change the text direction. This change adds an IPC message 'ViewMsg_SetTextDirection', which notifies the new text direction. Also, it adds two functions: RenderWidgetHost::UpdateTextDirection() and RenderWidgetHost::NotifyTextDirection(). They encapsulate the new IPC message so that we can use them both when we presses a set of keys and when we add context-menu items which change the text direction. 2. Calling the above interface when pressing right-shift and right-control keys, or when left-shift and left-control keys. This modifies the RenderWidgetHostViewWin::OnKeyEvent() function and call the above text-direction interfaces when a user finishes pressing the keys. As you can imagine, if we send an IPC message every time when we receive a WM_KEYDOWN event, we continue sending IPC messages while a user is pressing the keys. BUG=1845 Review URL: http://codereview.chromium.org/39252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webwidget.h')
-rw-r--r--webkit/glue/webwidget.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/glue/webwidget.h b/webkit/glue/webwidget.h
index 23046e8..b1b011d 100644
--- a/webkit/glue/webwidget.h
+++ b/webkit/glue/webwidget.h
@@ -6,6 +6,7 @@
#define WEBKIT_GLUE_WEBWIDGET_H__
#include "skia/ext/platform_canvas.h"
+#include "webkit/glue/webtextdirection.h"
namespace gfx {
class Rect;
@@ -64,6 +65,9 @@ class WebWidget {
// Retrieve the status of this widget required by IME APIs.
virtual bool ImeUpdateStatus(bool* enable_ime, gfx::Rect* caret_rect) = 0;
+ // Changes the text direction of the selected input node.
+ virtual void SetTextDirection(WebTextDirection direction) = 0;
+
protected:
virtual ~WebWidget() {}