| 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/renderer/render_view_mouse_lock_dispatcher.h" | 5 #include "content/renderer/render_view_mouse_lock_dispatcher.h" |
| 6 | 6 |
| 7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
| 8 #include "content/renderer/render_view_impl.h" | 8 #include "content/renderer/render_view_impl.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
| 12 | 12 |
| 13 namespace content { |
| 14 |
| 13 RenderViewMouseLockDispatcher::RenderViewMouseLockDispatcher( | 15 RenderViewMouseLockDispatcher::RenderViewMouseLockDispatcher( |
| 14 RenderViewImpl* render_view_impl) | 16 RenderViewImpl* render_view_impl) |
| 15 : content::RenderViewObserver(render_view_impl), | 17 : RenderViewObserver(render_view_impl), |
| 16 render_view_impl_(render_view_impl) { | 18 render_view_impl_(render_view_impl) { |
| 17 } | 19 } |
| 18 | 20 |
| 19 RenderViewMouseLockDispatcher::~RenderViewMouseLockDispatcher() { | 21 RenderViewMouseLockDispatcher::~RenderViewMouseLockDispatcher() { |
| 20 } | 22 } |
| 21 | 23 |
| 22 void RenderViewMouseLockDispatcher::SendLockMouseRequest( | 24 void RenderViewMouseLockDispatcher::SendLockMouseRequest( |
| 23 bool unlocked_by_target) { | 25 bool unlocked_by_target) { |
| 24 bool user_gesture = | 26 bool user_gesture = |
| 25 render_view_impl_->webview() && | 27 render_view_impl_->webview() && |
| (...skipping 27 matching lines...) Expand all Loading... |
| 53 | 55 |
| 54 // Mouse Lock removes the system cursor and provides all mouse motion as | 56 // Mouse Lock removes the system cursor and provides all mouse motion as |
| 55 // .movementX/Y values on events all sent to a fixed target. This requires | 57 // .movementX/Y values on events all sent to a fixed target. This requires |
| 56 // content to specifically request the mode to be entered. | 58 // content to specifically request the mode to be entered. |
| 57 // Mouse Capture is implicitly given for the duration of a drag event, and | 59 // Mouse Capture is implicitly given for the duration of a drag event, and |
| 58 // sends all mouse events to the initial target of the drag. | 60 // sends all mouse events to the initial target of the drag. |
| 59 // If Lock is entered it supercedes any in progress Capture. | 61 // If Lock is entered it supercedes any in progress Capture. |
| 60 if (succeeded && render_view_impl_->webwidget()) | 62 if (succeeded && render_view_impl_->webwidget()) |
| 61 render_view_impl_->webwidget()->mouseCaptureLost(); | 63 render_view_impl_->webwidget()->mouseCaptureLost(); |
| 62 } | 64 } |
| 65 |
| 66 } // namespace content |
| OLD | NEW |