| 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/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 result.data.tap.tapCount = 1; | 110 result.data.tap.tapCount = 1; |
| 111 result.data.tap.width = 10; | 111 result.data.tap.width = 10; |
| 112 result.data.tap.height = 10; | 112 result.data.tap.height = 10; |
| 113 } | 113 } |
| 114 return result; | 114 return result; |
| 115 } | 115 } |
| 116 | 116 |
| 117 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollBegin( | 117 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollBegin( |
| 118 float dx_hint, | 118 float dx_hint, |
| 119 float dy_hint, | 119 float dy_hint, |
| 120 blink::WebGestureDevice source_device) { | 120 blink::WebGestureDevice source_device, |
| 121 int pointer_count) { |
| 121 WebGestureEvent result = | 122 WebGestureEvent result = |
| 122 Build(WebInputEvent::GestureScrollBegin, source_device); | 123 Build(WebInputEvent::GestureScrollBegin, source_device); |
| 123 result.data.scrollBegin.deltaXHint = dx_hint; | 124 result.data.scrollBegin.deltaXHint = dx_hint; |
| 124 result.data.scrollBegin.deltaYHint = dy_hint; | 125 result.data.scrollBegin.deltaYHint = dy_hint; |
| 126 result.data.scrollBegin.pointerCount = pointer_count; |
| 125 return result; | 127 return result; |
| 126 } | 128 } |
| 127 | 129 |
| 128 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollUpdate( | 130 WebGestureEvent SyntheticWebGestureEventBuilder::BuildScrollUpdate( |
| 129 float dx, | 131 float dx, |
| 130 float dy, | 132 float dy, |
| 131 int modifiers, | 133 int modifiers, |
| 132 blink::WebGestureDevice source_device) { | 134 blink::WebGestureDevice source_device) { |
| 133 WebGestureEvent result = | 135 WebGestureEvent result = |
| 134 Build(WebInputEvent::GestureScrollUpdate, source_device, modifiers); | 136 Build(WebInputEvent::GestureScrollUpdate, source_device, modifiers); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 251 |
| 250 int SyntheticWebTouchEvent::FirstFreeIndex() { | 252 int SyntheticWebTouchEvent::FirstFreeIndex() { |
| 251 for (size_t i = 0; i < kTouchesLengthCap; ++i) { | 253 for (size_t i = 0; i < kTouchesLengthCap; ++i) { |
| 252 if (touches[i].state == WebTouchPoint::StateUndefined) | 254 if (touches[i].state == WebTouchPoint::StateUndefined) |
| 253 return i; | 255 return i; |
| 254 } | 256 } |
| 255 return -1; | 257 return -1; |
| 256 } | 258 } |
| 257 | 259 |
| 258 } // namespace content | 260 } // namespace content |
| OLD | NEW |