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

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

Issue 1324083002: Fix a mouse lock problem on Windows where in clicks outside the web page would also cause mouse loc… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 1515
1516 void RenderWidgetHostViewAura::UnlockMouse() { 1516 void RenderWidgetHostViewAura::UnlockMouse() {
1517 tooltip_disabler_.reset(); 1517 tooltip_disabler_.reset();
1518 1518
1519 aura::Window* root_window = window_->GetRootWindow(); 1519 aura::Window* root_window = window_->GetRootWindow();
1520 if (!mouse_locked_ || !root_window) 1520 if (!mouse_locked_ || !root_window)
1521 return; 1521 return;
1522 1522
1523 mouse_locked_ = false; 1523 mouse_locked_ = false;
1524 1524
1525 #if !defined(OS_WIN) 1525 if (window_->HasCapture())
1526 window_->ReleaseCapture(); 1526 window_->ReleaseCapture();
1527 #else 1527
1528 #if defined(OS_WIN)
1528 ::ClipCursor(NULL); 1529 ::ClipCursor(NULL);
1529 #endif 1530 #endif
1531
1530 window_->MoveCursorTo(unlocked_mouse_position_); 1532 window_->MoveCursorTo(unlocked_mouse_position_);
1531 aura::client::CursorClient* cursor_client = 1533 aura::client::CursorClient* cursor_client =
1532 aura::client::GetCursorClient(root_window); 1534 aura::client::GetCursorClient(root_window);
1533 if (cursor_client) { 1535 if (cursor_client) {
1534 cursor_client->UnlockCursor(); 1536 cursor_client->UnlockCursor();
1535 cursor_client->ShowCursor(); 1537 cursor_client->ShowCursor();
1536 } 1538 }
1537 1539
1538 host_->LostMouseLock(); 1540 host_->LostMouseLock();
1539 } 1541 }
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2837 2839
2838 //////////////////////////////////////////////////////////////////////////////// 2840 ////////////////////////////////////////////////////////////////////////////////
2839 // RenderWidgetHostViewBase, public: 2841 // RenderWidgetHostViewBase, public:
2840 2842
2841 // static 2843 // static
2842 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2844 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2843 GetScreenInfoForWindow(results, NULL); 2845 GetScreenInfoForWindow(results, NULL);
2844 } 2846 }
2845 2847
2846 } // namespace content 2848 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698