| 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 "ui/events/keycodes/keyboard_codes.h" | 8 #include "ui/events/keycodes/keyboard_codes.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 WebGestureEvent SyntheticWebGestureEventBuilder::Build( | 82 WebGestureEvent SyntheticWebGestureEventBuilder::Build( |
| 83 WebInputEvent::Type type, | 83 WebInputEvent::Type type, |
| 84 WebGestureEvent::SourceDevice source_device) { | 84 WebGestureEvent::SourceDevice source_device) { |
| 85 DCHECK(WebInputEvent::isGestureEventType(type)); | 85 DCHECK(WebInputEvent::isGestureEventType(type)); |
| 86 WebGestureEvent result; | 86 WebGestureEvent result; |
| 87 result.type = type; | 87 result.type = type; |
| 88 result.sourceDevice = source_device; | 88 result.sourceDevice = source_device; |
| 89 return result; | 89 return result; |
| 90 } | 90 } |
| 91 | 91 |
| 92 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollBegin( |
| 93 float dx_hint, |
| 94 float dy_hint) { |
| 95 WebGestureEvent result = Build(WebInputEvent::GestureScrollBegin, |
| 96 WebGestureEvent::Touchscreen); |
| 97 result.data.scrollBegin.deltaXHint = dx_hint; |
| 98 result.data.scrollBegin.deltaYHint = dy_hint; |
| 99 return result; |
| 100 } |
| 101 |
| 92 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollUpdate( | 102 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollUpdate( |
| 93 float dx, | 103 float dx, |
| 94 float dy, | 104 float dy, |
| 95 int modifiers) { | 105 int modifiers) { |
| 96 WebGestureEvent result = Build(WebInputEvent::GestureScrollUpdate, | 106 WebGestureEvent result = Build(WebInputEvent::GestureScrollUpdate, |
| 97 WebGestureEvent::Touchscreen); | 107 WebGestureEvent::Touchscreen); |
| 98 result.data.scrollUpdate.deltaX = dx; | 108 result.data.scrollUpdate.deltaX = dx; |
| 99 result.data.scrollUpdate.deltaY = dy; | 109 result.data.scrollUpdate.deltaY = dy; |
| 100 result.modifiers = modifiers; | 110 result.modifiers = modifiers; |
| 101 return result; | 111 return result; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 193 |
| 184 SyntheticWebTouchEvent SyntheticWebTouchEventBuilder::Build( | 194 SyntheticWebTouchEvent SyntheticWebTouchEventBuilder::Build( |
| 185 WebInputEvent::Type type) { | 195 WebInputEvent::Type type) { |
| 186 DCHECK(WebInputEvent::isTouchEventType(type)); | 196 DCHECK(WebInputEvent::isTouchEventType(type)); |
| 187 SyntheticWebTouchEvent result; | 197 SyntheticWebTouchEvent result; |
| 188 result.type = type; | 198 result.type = type; |
| 189 return result; | 199 return result; |
| 190 }; | 200 }; |
| 191 | 201 |
| 192 } // namespace content | 202 } // namespace content |
| OLD | NEW |