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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 8072011: Only allow to lock the mouse when the tab is in fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Need a few defines from Win 7 headers for WM_GESTURE and 5 // Need a few defines from Win 7 headers for WM_GESTURE and
6 // ChangeWindowMessageFilterEx. 6 // ChangeWindowMessageFilterEx.
7 // TODO(jschuh): See crbug.com/92941 for longterm fix. 7 // TODO(jschuh): See crbug.com/92941 for longterm fix.
8 #include <windows.h> 8 #include <windows.h>
9 #if(WINVER < 0x0601) 9 #if(WINVER < 0x0601)
10 typedef struct tagCHANGEFILTERSTRUCT { 10 typedef struct tagCHANGEFILTERSTRUCT {
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 LRESULT RenderWidgetHostViewWin::OnKeyEvent(UINT message, WPARAM wparam, 1300 LRESULT RenderWidgetHostViewWin::OnKeyEvent(UINT message, WPARAM wparam,
1301 LPARAM lparam, BOOL& handled) { 1301 LPARAM lparam, BOOL& handled) {
1302 handled = TRUE; 1302 handled = TRUE;
1303 1303
1304 // Force fullscreen windows to close on Escape. 1304 // Force fullscreen windows to close on Escape.
1305 if ((message == WM_KEYDOWN || message == WM_KEYUP) && wparam == VK_ESCAPE) { 1305 if ((message == WM_KEYDOWN || message == WM_KEYUP) && wparam == VK_ESCAPE) {
1306 if (mouse_locked_) 1306 if (mouse_locked_)
1307 UnlockMouse(); 1307 UnlockMouse();
1308 if (is_fullscreen_) 1308 if (is_fullscreen_)
1309 SendMessage(WM_CANCELMODE); 1309 SendMessage(WM_CANCELMODE);
1310 return 0; 1310 return 0;
1311 } 1311 }
1312 1312
1313 // If we are a pop-up, forward tab related messages to our parent HWND, so 1313 // If we are a pop-up, forward tab related messages to our parent HWND, so
1314 // that we are dismissed appropriately and so that the focus advance in our 1314 // that we are dismissed appropriately and so that the focus advance in our
1315 // parent. 1315 // parent.
1316 // TODO(jcampan): http://b/issue?id=1192881 Could be abstracted in the 1316 // TODO(jcampan): http://b/issue?id=1192881 Could be abstracted in the
1317 // FocusManager. 1317 // FocusManager.
1318 if (close_on_deactivate_ && 1318 if (close_on_deactivate_ &&
1319 (((message == WM_KEYDOWN || message == WM_KEYUP) && (wparam == VK_TAB)) || 1319 (((message == WM_KEYDOWN || message == WM_KEYUP) && (wparam == VK_TAB)) ||
1320 (message == WM_CHAR && wparam == L'\t'))) { 1320 (message == WM_CHAR && wparam == L'\t'))) {
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 if (message == WM_MOUSEMOVE) { 1951 if (message == WM_MOUSEMOVE) {
1952 CPoint center = GetClientCenter(); 1952 CPoint center = GetClientCenter();
1953 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter(). 1953 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter().
1954 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y) 1954 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y)
1955 return; 1955 return;
1956 } 1956 }
1957 1957
1958 ForwardMouseEventToRenderer(message, wparam, lparam); 1958 ForwardMouseEventToRenderer(message, wparam, lparam);
1959 } 1959 }
1960 1960
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698