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_pointer.h" | 5 #include "content/browser/renderer_host/input/synthetic_mouse_pointer.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 15 matching lines...) Expand all Loading... |
26 blink::WebInputEvent::MouseDown, x, y, 0); | 26 blink::WebInputEvent::MouseDown, x, y, 0); |
27 mouse_event_.clickCount = 1; | 27 mouse_event_.clickCount = 1; |
28 return 0; | 28 return 0; |
29 } | 29 } |
30 | 30 |
31 void SyntheticMousePointer::Move(int index, | 31 void SyntheticMousePointer::Move(int index, |
32 float x, | 32 float x, |
33 float y, | 33 float y, |
34 SyntheticGestureTarget* target, | 34 SyntheticGestureTarget* target, |
35 const base::TimeTicks& timestamp) { | 35 const base::TimeTicks& timestamp) { |
| 36 blink::WebMouseEvent::Button button = mouse_event_.button; |
| 37 int click_count = mouse_event_.clickCount; |
36 mouse_event_ = SyntheticWebMouseEventBuilder::Build( | 38 mouse_event_ = SyntheticWebMouseEventBuilder::Build( |
37 blink::WebInputEvent::MouseMove, x, y, 0); | 39 blink::WebInputEvent::MouseMove, x, y, 0); |
38 mouse_event_.button = blink::WebMouseEvent::ButtonLeft; | 40 mouse_event_.button = button; |
| 41 mouse_event_.clickCount = click_count; |
39 } | 42 } |
40 | 43 |
41 void SyntheticMousePointer::Release(int index, | 44 void SyntheticMousePointer::Release(int index, |
42 SyntheticGestureTarget* target, | 45 SyntheticGestureTarget* target, |
43 const base::TimeTicks& timestamp) { | 46 const base::TimeTicks& timestamp) { |
44 mouse_event_ = SyntheticWebMouseEventBuilder::Build( | 47 mouse_event_ = SyntheticWebMouseEventBuilder::Build( |
45 blink::WebInputEvent::MouseUp, mouse_event_.x, mouse_event_.y, 0); | 48 blink::WebInputEvent::MouseUp, mouse_event_.x, mouse_event_.y, 0); |
46 mouse_event_.clickCount = 1; | 49 mouse_event_.clickCount = 1; |
47 } | 50 } |
48 | 51 |
49 SyntheticGestureParams::GestureSourceType SyntheticMousePointer::SourceType() | 52 SyntheticGestureParams::GestureSourceType SyntheticMousePointer::SourceType() |
50 const { | 53 const { |
51 return SyntheticGestureParams::MOUSE_INPUT; | 54 return SyntheticGestureParams::MOUSE_INPUT; |
52 } | 55 } |
53 | 56 |
54 } // namespace content | 57 } // namespace content |
OLD | NEW |