OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/events/mojo/event_struct_traits.h" | 5 #include "ui/events/mojo/event_struct_traits.h" |
6 | 6 |
7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
8 #include "ui/events/event_utils.h" | 8 #include "ui/events/event_utils.h" |
9 #include "ui/events/keycodes/dom/keycode_converter.h" | 9 #include "ui/events/keycodes/dom/keycode_converter.h" |
10 #include "ui/events/mojo/event_constants.mojom.h" | 10 #include "ui/events/mojo/event_constants.mojom.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 MojoPointerEventTypeToUIEvent(event.action()), location, | 288 MojoPointerEventTypeToUIEvent(event.action()), location, |
289 screen_location, event.flags(), | 289 screen_location, event.flags(), |
290 pointer_data->changed_button_flags, | 290 pointer_data->changed_button_flags, |
291 event.action() == ui::mojom::EventType::POINTER_WHEEL_CHANGED | 291 event.action() == ui::mojom::EventType::POINTER_WHEEL_CHANGED |
292 ? ui::PointerDetails( | 292 ? ui::PointerDetails( |
293 ui::EventPointerType::POINTER_TYPE_MOUSE, | 293 ui::EventPointerType::POINTER_TYPE_MOUSE, |
294 gfx::Vector2d( | 294 gfx::Vector2d( |
295 static_cast<int>(pointer_data->wheel_data->delta_x), | 295 static_cast<int>(pointer_data->wheel_data->delta_x), |
296 static_cast<int>( | 296 static_cast<int>( |
297 pointer_data->wheel_data->delta_y)), | 297 pointer_data->wheel_data->delta_y)), |
298 ui::MouseEvent::kMousePointerId) | 298 ui::MouseEvent::kDefaultMousePointerId) |
299 : ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, | 299 : ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, |
300 ui::MouseEvent::kMousePointerId), | 300 ui::MouseEvent::kDefaultMousePointerId), |
301 ui::EventTimeForNow())); | 301 ui::EventTimeForNow())); |
302 break; | 302 break; |
303 } | 303 } |
304 case ui::mojom::PointerKind::TOUCH: { | 304 case ui::mojom::PointerKind::TOUCH: { |
305 out->reset(new ui::PointerEvent( | 305 out->reset(new ui::PointerEvent( |
306 MojoPointerEventTypeToUIEvent(event.action()), location, | 306 MojoPointerEventTypeToUIEvent(event.action()), location, |
307 screen_location, event.flags(), | 307 screen_location, event.flags(), |
308 pointer_data->changed_button_flags, | 308 pointer_data->changed_button_flags, |
309 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, | 309 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, |
310 /* pointer_id*/ pointer_data->pointer_id, | 310 /* pointer_id*/ pointer_data->pointer_id, |
(...skipping 15 matching lines...) Expand all Loading... |
326 return false; | 326 return false; |
327 } | 327 } |
328 | 328 |
329 if (!out->get()) | 329 if (!out->get()) |
330 return false; | 330 return false; |
331 | 331 |
332 return event.ReadLatency((*out)->latency()); | 332 return event.ReadLatency((*out)->latency()); |
333 } | 333 } |
334 | 334 |
335 } // namespace mojo | 335 } // namespace mojo |
OLD | NEW |