OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/input/synthetic_web_input_event_builders.h" | 5 #include "content/common/input/synthetic_web_input_event_builders.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/common/input/web_touch_event_traits.h" | 8 #include "content/common/input/web_touch_event_traits.h" |
9 #include "ui/events/keycodes/keyboard_codes.h" | 9 #include "ui/events/keycodes/keyboard_codes.h" |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 WebMouseWheelEvent result; | 61 WebMouseWheelEvent result; |
62 result.type = WebInputEvent::MouseWheel; | 62 result.type = WebInputEvent::MouseWheel; |
63 result.deltaX = dx; | 63 result.deltaX = dx; |
64 result.deltaY = dy; | 64 result.deltaY = dy; |
65 if (dx) | 65 if (dx) |
66 result.wheelTicksX = dx > 0.0f ? 1.0f : -1.0f; | 66 result.wheelTicksX = dx > 0.0f ? 1.0f : -1.0f; |
67 if (dy) | 67 if (dy) |
68 result.wheelTicksY = dy > 0.0f ? 1.0f : -1.0f; | 68 result.wheelTicksY = dy > 0.0f ? 1.0f : -1.0f; |
69 result.modifiers = modifiers; | 69 result.modifiers = modifiers; |
70 result.hasPreciseScrollingDeltas = precise; | 70 result.hasPreciseScrollingDeltas = precise; |
71 result.canScroll = true; | |
72 return result; | 71 return result; |
73 } | 72 } |
74 | 73 |
75 WebKeyboardEvent SyntheticWebKeyboardEventBuilder::Build( | 74 WebKeyboardEvent SyntheticWebKeyboardEventBuilder::Build( |
76 WebInputEvent::Type type) { | 75 WebInputEvent::Type type) { |
77 DCHECK(WebInputEvent::isKeyboardEventType(type)); | 76 DCHECK(WebInputEvent::isKeyboardEventType(type)); |
78 WebKeyboardEvent result; | 77 WebKeyboardEvent result; |
79 result.type = type; | 78 result.type = type; |
80 result.windowsKeyCode = ui::VKEY_L; // non-null made up value. | 79 result.windowsKeyCode = ui::VKEY_L; // non-null made up value. |
81 return result; | 80 return result; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 touches[index].state = WebTouchPoint::StateCancelled; | 209 touches[index].state = WebTouchPoint::StateCancelled; |
211 WebTouchEventTraits::ResetType( | 210 WebTouchEventTraits::ResetType( |
212 WebInputEvent::TouchCancel, timeStampSeconds, this); | 211 WebInputEvent::TouchCancel, timeStampSeconds, this); |
213 } | 212 } |
214 | 213 |
215 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { | 214 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { |
216 timeStampSeconds = timestamp.InSecondsF(); | 215 timeStampSeconds = timestamp.InSecondsF(); |
217 } | 216 } |
218 | 217 |
219 } // namespace content | 218 } // namespace content |
OLD | NEW |