| 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/base_event_utils.h" | 9 #include "ui/events/base_event_utils.h" |
| 10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 type == WebInputEvent::GestureDoubleTap) { | 111 type == WebInputEvent::GestureDoubleTap) { |
| 112 result.data.tap.tapCount = 1; | 112 result.data.tap.tapCount = 1; |
| 113 result.data.tap.width = 10; | 113 result.data.tap.width = 10; |
| 114 result.data.tap.height = 10; | 114 result.data.tap.height = 10; |
| 115 } | 115 } |
| 116 return result; | 116 return result; |
| 117 } | 117 } |
| 118 | 118 |
| 119 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollBegin( | 119 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollBegin( |
| 120 float dx_hint, | 120 float dx_hint, |
| 121 float dy_hint) { | 121 float dy_hint, |
| 122 WebGestureEvent result = Build(WebInputEvent::GestureScrollBegin, | 122 blink::WebGestureDevice source_device) { |
| 123 blink::WebGestureDeviceTouchscreen); | 123 WebGestureEvent result = |
| 124 Build(WebInputEvent::GestureScrollBegin, source_device); |
| 124 result.data.scrollBegin.deltaXHint = dx_hint; | 125 result.data.scrollBegin.deltaXHint = dx_hint; |
| 125 result.data.scrollBegin.deltaYHint = dy_hint; | 126 result.data.scrollBegin.deltaYHint = dy_hint; |
| 126 return result; | 127 return result; |
| 127 } | 128 } |
| 128 | 129 |
| 129 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollUpdate( | 130 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollUpdate( |
| 130 float dx, | 131 float dx, |
| 131 float dy, | 132 float dy, |
| 132 int modifiers, | 133 int modifiers, |
| 133 blink::WebGestureDevice source_device) { | 134 blink::WebGestureDevice source_device) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 touches[index].state = WebTouchPoint::StateCancelled; | 235 touches[index].state = WebTouchPoint::StateCancelled; |
| 235 WebTouchEventTraits::ResetType( | 236 WebTouchEventTraits::ResetType( |
| 236 WebInputEvent::TouchCancel, timeStampSeconds, this); | 237 WebInputEvent::TouchCancel, timeStampSeconds, this); |
| 237 } | 238 } |
| 238 | 239 |
| 239 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { | 240 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { |
| 240 timeStampSeconds = timestamp.InSecondsF(); | 241 timeStampSeconds = timestamp.InSecondsF(); |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace content | 244 } // namespace content |
| OLD | NEW |