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 |
11 SyntheticMouseDriver::SyntheticMouseDriver() {} | 11 SyntheticMouseDriver::SyntheticMouseDriver() {} |
12 | 12 |
13 SyntheticMouseDriver::~SyntheticMouseDriver() {} | 13 SyntheticMouseDriver::~SyntheticMouseDriver() {} |
14 | 14 |
15 void SyntheticMouseDriver::DispatchEvent(SyntheticGestureTarget* target, | 15 void SyntheticMouseDriver::DispatchEvent(SyntheticGestureTarget* target, |
16 const base::TimeTicks& timestamp) { | 16 const base::TimeTicks& timestamp) { |
17 mouse_event_.timeStampSeconds = ConvertTimestampToSeconds(timestamp); | 17 mouse_event_.setTimeStampSeconds(ConvertTimestampToSeconds(timestamp)); |
18 target->DispatchInputEventToPlatform(mouse_event_); | 18 target->DispatchInputEventToPlatform(mouse_event_); |
19 } | 19 } |
20 | 20 |
21 void SyntheticMouseDriver::Press(float x, float y, int index) { | 21 void SyntheticMouseDriver::Press(float x, float y, int index) { |
22 DCHECK_EQ(index, 0); | 22 DCHECK_EQ(index, 0); |
23 mouse_event_ = SyntheticWebMouseEventBuilder::Build( | 23 mouse_event_ = SyntheticWebMouseEventBuilder::Build( |
24 blink::WebInputEvent::MouseDown, x, y, 0); | 24 blink::WebInputEvent::MouseDown, x, y, 0); |
25 mouse_event_.clickCount = 1; | 25 mouse_event_.clickCount = 1; |
26 } | 26 } |
27 | 27 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (params.pointer_action_type() == | 61 if (params.pointer_action_type() == |
62 SyntheticPointerActionParams::PointerActionType::RELEASE && | 62 SyntheticPointerActionParams::PointerActionType::RELEASE && |
63 mouse_event_.clickCount <= 0) { | 63 mouse_event_.clickCount <= 0) { |
64 return false; | 64 return false; |
65 } | 65 } |
66 | 66 |
67 return true; | 67 return true; |
68 } | 68 } |
69 | 69 |
70 } // namespace content | 70 } // namespace content |
OLD | NEW |