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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 39252: A tricky fix for Issue 1845.... (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/browser/renderer_host/render_widget_host.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_win.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_win.cc (revision 11937)
+++ chrome/browser/renderer_host/render_widget_host_view_win.cc (working copy)
@@ -823,6 +823,26 @@
return ::SendMessage(parent_hwnd_, message, wparam, lparam);
}
+ if (wparam == VK_SHIFT || wparam == VK_CONTROL) {
+ // Bug 1845: we need to update the text direction when a user releases
+ // either a right-shift key or a right-control key after pressing both of
+ // them. So, we just update the text direction while a user is pressing the
+ // keys, and we notify the text direction when a user releases either of
+ // them.
+ if (message == WM_KEYDOWN) {
+ const int kKeyDownMask = 0x8000;
+ if ((GetKeyState(VK_RSHIFT) & kKeyDownMask) &&
+ (GetKeyState(VK_RCONTROL) & kKeyDownMask)) {
+ render_widget_host_->UpdateTextDirection(WEB_TEXT_DIRECTION_RTL);
+ } else if ((GetKeyState(VK_LSHIFT) & kKeyDownMask) &&
+ (GetKeyState(VK_LCONTROL) & kKeyDownMask)) {
+ render_widget_host_->UpdateTextDirection(WEB_TEXT_DIRECTION_LTR);
+ }
+ } else if (message == WM_KEYUP) {
+ render_widget_host_->NotifyTextDirection();
+ }
+ }
+
render_widget_host_->ForwardKeyboardEvent(
NativeWebKeyboardEvent(m_hWnd, message, wparam, lparam));
return 0;
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698