| 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 20 matching lines...) Expand all Loading... |
| 31 int window_x, | 31 int window_x, |
| 32 int window_y, | 32 int window_y, |
| 33 int modifiers, | 33 int modifiers, |
| 34 blink::WebPointerProperties::PointerType pointer_type) { | 34 blink::WebPointerProperties::PointerType pointer_type) { |
| 35 DCHECK(WebInputEvent::IsMouseEventType(type)); | 35 DCHECK(WebInputEvent::IsMouseEventType(type)); |
| 36 WebMouseEvent result(type, modifiers, | 36 WebMouseEvent result(type, modifiers, |
| 37 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); | 37 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); |
| 38 result.SetPositionInWidget(window_x, window_y); | 38 result.SetPositionInWidget(window_x, window_y); |
| 39 result.SetModifiers(modifiers); | 39 result.SetModifiers(modifiers); |
| 40 result.pointer_type = pointer_type; | 40 result.pointer_type = pointer_type; |
| 41 result.id = ui::MouseEvent::kMousePointerId; | 41 result.id = ui::MouseEvent::kDefaultMousePointerId; |
| 42 return result; | 42 return result; |
| 43 } | 43 } |
| 44 | 44 |
| 45 WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build( | 45 WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build( |
| 46 WebMouseWheelEvent::Phase phase) { | 46 WebMouseWheelEvent::Phase phase) { |
| 47 WebMouseWheelEvent result(WebInputEvent::kMouseWheel, | 47 WebMouseWheelEvent result(WebInputEvent::kMouseWheel, |
| 48 WebInputEvent::kNoModifiers, | 48 WebInputEvent::kNoModifiers, |
| 49 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); | 49 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); |
| 50 result.phase = phase; | 50 result.phase = phase; |
| 51 return result; | 51 return result; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 int SyntheticWebTouchEvent::FirstFreeIndex() { | 247 int SyntheticWebTouchEvent::FirstFreeIndex() { |
| 248 for (size_t i = 0; i < kTouchesLengthCap; ++i) { | 248 for (size_t i = 0; i < kTouchesLengthCap; ++i) { |
| 249 if (touches[i].state == WebTouchPoint::kStateUndefined) | 249 if (touches[i].state == WebTouchPoint::kStateUndefined) |
| 250 return i; | 250 return i; |
| 251 } | 251 } |
| 252 return -1; | 252 return -1; |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace content | 255 } // namespace content |
| OLD | NEW |