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

Issue 39252: A tricky fix for Issue 1845.... (Closed)

Created:
11 years, 9 months ago by Hironori Bono
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=11953

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 14

Patch Set 5 : '' #

Total comments: 2

Patch Set 6 : '' #

Patch Set 7 : '' #

Total comments: 3

Patch Set 8 : '' #

Patch Set 9 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -1 line) Patch
M chrome/browser/renderer_host/render_widget_host.h View 1 2 3 4 5 6 7 8 3 chunks +37 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 3 4 5 6 7 8 2 chunks +16 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.cc View 5 6 7 8 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/common/render_messages.h View 1 6 7 8 2 chunks +34 lines, -0 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 7 8 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/render_view_unittest.cc View 2 3 4 5 6 7 8 1 chunk +48 lines, -0 lines 0 comments Download
M chrome/renderer/render_widget.h View 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/renderer/render_widget.cc View 5 6 7 8 2 chunks +8 lines, -0 lines 0 comments Download
A webkit/glue/webtextdirection.h View 6 7 1 chunk +22 lines, -0 lines 0 comments Download
M webkit/glue/webview_impl.h View 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M webkit/glue/webview_impl.cc View 5 6 7 8 1 chunk +31 lines, -0 lines 0 comments Download
M webkit/glue/webwidget.h View 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M webkit/glue/webwidget_impl.h View 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M webkit/glue/webwidget_impl.cc View 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Hironori Bono
11 years, 9 months ago (2009-03-09 09:39:01 UTC) #1
Hironori Bono
Hi Darin, I have added an IPC message that changes the text direction of a ...
11 years, 9 months ago (2009-03-09 10:02:30 UTC) #2
jeremy
LGTM with a few nits. This fix will make many people very happy :) http://codereview.chromium.org/39252/diff/30/1047 ...
11 years, 9 months ago (2009-03-09 10:07:41 UTC) #3
Hironori Bono
Hi Darin, On 2009/03/09 10:02:30, hbono wrote: > Hi Darin, I have added an IPC ...
11 years, 9 months ago (2009-03-09 13:28:54 UTC) #4
darin (slow to review)
http://codereview.chromium.org/39252/diff/30/1037 File webkit/glue/webframe.h (right): http://codereview.chromium.org/39252/diff/30/1037#newcode364 Line 364: virtual void SetTextDirection(bool right_to_left) = 0; oh, this ...
11 years, 9 months ago (2009-03-09 17:00:59 UTC) #5
jungshik at Google
http://codereview.chromium.org/39252/diff/30/1037 File webkit/glue/webframe.h (right): http://codereview.chromium.org/39252/diff/30/1037#newcode364 Line 364: virtual void SetTextDirection(bool right_to_left) = 0; On 2009/03/09 ...
11 years, 9 months ago (2009-03-10 22:44:01 UTC) #6
brettw
http://codereview.chromium.org/39252/diff/30/1042 File chrome/browser/renderer_host/render_widget_host.cc (right): http://codereview.chromium.org/39252/diff/30/1042#newcode316 Line 316: if (key_event.windows_key_code == base::VKEY_SHIFT || Is this code ...
11 years, 9 months ago (2009-03-11 14:36:17 UTC) #7
jungshik at Google
http://codereview.chromium.org/39252/diff/3003/3005 File chrome/browser/renderer_host/render_widget_host.h (right): http://codereview.chromium.org/39252/diff/3003/3005#newcode227 Line 227: void UpdateTextDirection(bool right_to_left); I'm afraid this function is ...
11 years, 9 months ago (2009-03-13 20:52:35 UTC) #8
Hironori Bono
Thank you all for your great comments and sorry for my slow updates. I finally ...
11 years, 9 months ago (2009-03-16 11:16:42 UTC) #9
brettw
11 years, 9 months ago (2009-03-16 20:54:15 UTC) #10
LGTM. Can you address the following minor comments before you check in?

http://codereview.chromium.org/39252/diff/2015/2017
File chrome/browser/renderer_host/render_widget_host.h (right):

http://codereview.chromium.org/39252/diff/2015/2017#newcode230
Line 230: void NotifyTextDirection();
It's not clear to me as a caller how I should call these two functions. When
should I use one versus the other?

http://codereview.chromium.org/39252/diff/2015/2027
File chrome/browser/renderer_host/render_widget_host_view_win.cc (right):

http://codereview.chromium.org/39252/diff/2015/2027#newcode833
Line 833: if ((GetKeyState(VK_RSHIFT) & 0x8000) &&
What do you think about making a constant local to this function with a
descriptive name instead of hardcoding 0x8000 everywhere?

http://codereview.chromium.org/39252/diff/2015/2030
File webkit/glue/webtextdirection.h (right):

http://codereview.chromium.org/39252/diff/2015/2030#newcode5
Line 5: #ifndef WEBKIT_GLUE_WEBTEXTDIRECTION_H__
Use only one underscore at the end of include guards now (they changed the style
guide).

Powered by Google App Engine
This is Rietveld 408576698