| 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 22 matching lines...) Expand all Loading... |
| 33 int modifiers) { | 33 int modifiers) { |
| 34 DCHECK(WebInputEvent::isMouseEventType(type)); | 34 DCHECK(WebInputEvent::isMouseEventType(type)); |
| 35 WebMouseEvent result = Build(type); | 35 WebMouseEvent result = Build(type); |
| 36 result.x = window_x; | 36 result.x = window_x; |
| 37 result.y = window_y; | 37 result.y = window_y; |
| 38 result.windowX = window_x; | 38 result.windowX = window_x; |
| 39 result.windowY = window_y; | 39 result.windowY = window_y; |
| 40 result.modifiers = modifiers; | 40 result.modifiers = modifiers; |
| 41 | 41 |
| 42 if (type == WebInputEvent::MouseDown || type == WebInputEvent::MouseUp) | 42 if (type == WebInputEvent::MouseDown || type == WebInputEvent::MouseUp) |
| 43 result.button = WebMouseEvent::ButtonLeft; | 43 result.button = WebMouseEvent::Button::Left; |
| 44 else | 44 else |
| 45 result.button = WebMouseEvent::ButtonNone; | 45 result.button = WebMouseEvent::Button::NoButton; |
| 46 | 46 |
| 47 return result; | 47 return result; |
| 48 } | 48 } |
| 49 | 49 |
| 50 WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build( | 50 WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build( |
| 51 WebMouseWheelEvent::Phase phase) { | 51 WebMouseWheelEvent::Phase phase) { |
| 52 WebMouseWheelEvent result; | 52 WebMouseWheelEvent result; |
| 53 result.type = WebInputEvent::MouseWheel; | 53 result.type = WebInputEvent::MouseWheel; |
| 54 result.phase = phase; | 54 result.phase = phase; |
| 55 return result; | 55 return result; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 touches[index].state = WebTouchPoint::StateCancelled; | 234 touches[index].state = WebTouchPoint::StateCancelled; |
| 235 WebTouchEventTraits::ResetType( | 235 WebTouchEventTraits::ResetType( |
| 236 WebInputEvent::TouchCancel, timeStampSeconds, this); | 236 WebInputEvent::TouchCancel, timeStampSeconds, this); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void SyntheticWebTouchEvent::SetTimestamp(base::TimeTicks timestamp) { | 239 void SyntheticWebTouchEvent::SetTimestamp(base::TimeTicks timestamp) { |
| 240 timeStampSeconds = ui::EventTimeStampToSeconds(timestamp); | 240 timeStampSeconds = ui::EventTimeStampToSeconds(timestamp); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace content | 243 } // namespace content |
| OLD | NEW |