OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/converters/input_events/input_events_type_converters.h" | 5 #include "mojo/converters/input_events/input_events_type_converters.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #if defined(USE_X11) | 11 #if defined(USE_X11) |
12 #include <X11/extensions/XInput2.h> | 12 #include <X11/extensions/XInput2.h> |
13 #include <X11/Xlib.h> | 13 #include <X11/Xlib.h> |
14 #endif | 14 #endif |
15 | 15 |
16 #include "components/mus/public/interfaces/input_events.mojom.h" | 16 #include "components/mus/public/interfaces/input_events.mojom.h" |
17 #include "mojo/converters/geometry/geometry_type_converters.h" | |
18 #include "mojo/converters/input_events/mojo_extended_key_event_data.h" | 17 #include "mojo/converters/input_events/mojo_extended_key_event_data.h" |
19 #include "ui/events/event_utils.h" | 18 #include "ui/events/event_utils.h" |
20 #include "ui/events/keycodes/dom/keycode_converter.h" | 19 #include "ui/events/keycodes/dom/keycode_converter.h" |
21 #include "ui/events/keycodes/keyboard_codes.h" | 20 #include "ui/events/keycodes/keyboard_codes.h" |
| 21 #include "ui/gfx/geometry/mojo/geometry_type_converters.h" |
22 | 22 |
23 namespace mojo { | 23 namespace mojo { |
24 namespace { | 24 namespace { |
25 | 25 |
26 ui::EventType MojoMouseEventTypeToUIEvent(const mus::mojom::EventPtr& event) { | 26 ui::EventType MojoMouseEventTypeToUIEvent(const mus::mojom::EventPtr& event) { |
27 DCHECK(event->pointer_data); | 27 DCHECK(event->pointer_data); |
28 DCHECK_EQ(mus::mojom::PointerKind::MOUSE, event->pointer_data->kind); | 28 DCHECK_EQ(mus::mojom::PointerKind::MOUSE, event->pointer_data->kind); |
29 switch (event->action) { | 29 switch (event->action) { |
30 case mus::mojom::EventType::POINTER_DOWN: | 30 case mus::mojom::EventType::POINTER_DOWN: |
31 return ui::ET_MOUSE_PRESSED; | 31 return ui::ET_MOUSE_PRESSED; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 } break; | 412 } break; |
413 | 413 |
414 default: | 414 default: |
415 NOTIMPLEMENTED(); | 415 NOTIMPLEMENTED(); |
416 } | 416 } |
417 // TODO: need to support time_stamp. | 417 // TODO: need to support time_stamp. |
418 return nullptr; | 418 return nullptr; |
419 } | 419 } |
420 | 420 |
421 } // namespace mojo | 421 } // namespace mojo |
OLD | NEW |