OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |