OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/input/synthetic_mouse_driver.h" | 5 #include "content/browser/renderer_host/input/synthetic_mouse_driver.h" |
6 | 6 |
7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 mouse_event_.pointerType); | 45 mouse_event_.pointerType); |
46 mouse_event_.button = button; | 46 mouse_event_.button = button; |
47 mouse_event_.clickCount = click_count; | 47 mouse_event_.clickCount = click_count; |
48 } | 48 } |
49 | 49 |
50 void SyntheticMouseDriver::Release( | 50 void SyntheticMouseDriver::Release( |
51 int index, | 51 int index, |
52 SyntheticPointerActionParams::Button button) { | 52 SyntheticPointerActionParams::Button button) { |
53 DCHECK_EQ(index, 0); | 53 DCHECK_EQ(index, 0); |
54 mouse_event_ = SyntheticWebMouseEventBuilder::Build( | 54 mouse_event_ = SyntheticWebMouseEventBuilder::Build( |
55 blink::WebInputEvent::MouseUp, mouse_event_.x, mouse_event_.y, | 55 blink::WebInputEvent::MouseUp, mouse_event_.positionInWidget().x, |
56 last_modifiers_, mouse_event_.pointerType); | 56 mouse_event_.positionInWidget().y, last_modifiers_, |
| 57 mouse_event_.pointerType); |
57 mouse_event_.clickCount = 1; | 58 mouse_event_.clickCount = 1; |
58 mouse_event_.button = | 59 mouse_event_.button = |
59 SyntheticPointerActionParams::GetWebMouseEventButton(button); | 60 SyntheticPointerActionParams::GetWebMouseEventButton(button); |
60 last_modifiers_ = | 61 last_modifiers_ = |
61 last_modifiers_ & | 62 last_modifiers_ & |
62 (~SyntheticPointerActionParams::GetWebMouseEventModifier(button)); | 63 (~SyntheticPointerActionParams::GetWebMouseEventModifier(button)); |
63 } | 64 } |
64 | 65 |
65 bool SyntheticMouseDriver::UserInputCheck( | 66 bool SyntheticMouseDriver::UserInputCheck( |
66 const SyntheticPointerActionParams& params) const { | 67 const SyntheticPointerActionParams& params) const { |
(...skipping 16 matching lines...) Expand all Loading... |
83 if (params.pointer_action_type() == | 84 if (params.pointer_action_type() == |
84 SyntheticPointerActionParams::PointerActionType::RELEASE && | 85 SyntheticPointerActionParams::PointerActionType::RELEASE && |
85 mouse_event_.clickCount <= 0) { | 86 mouse_event_.clickCount <= 0) { |
86 return false; | 87 return false; |
87 } | 88 } |
88 | 89 |
89 return true; | 90 return true; |
90 } | 91 } |
91 | 92 |
92 } // namespace content | 93 } // namespace content |
OLD | NEW |