Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: ui/events/mojo/input_events_type_converters.cc

Issue 2008193002: Change mojo geometry structs from using type converters to StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/input_events_type_converters.h" 5 #include "ui/events/mojo/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 "ui/events/event_utils.h" 17 #include "ui/events/event_utils.h"
18 #include "ui/events/keycodes/dom/keycode_converter.h" 18 #include "ui/events/keycodes/dom/keycode_converter.h"
19 #include "ui/events/keycodes/keyboard_codes.h" 19 #include "ui/events/keycodes/keyboard_codes.h"
20 #include "ui/events/mojo/mojo_extended_key_event_data.h" 20 #include "ui/events/mojo/mojo_extended_key_event_data.h"
21 #include "ui/gfx/geometry/mojo/geometry_type_converters.h"
22 21
23 namespace mojo { 22 namespace mojo {
24 namespace { 23 namespace {
25 24
26 ui::EventType MojoMouseEventTypeToUIEvent(const mus::mojom::EventPtr& event) { 25 ui::EventType MojoMouseEventTypeToUIEvent(const mus::mojom::EventPtr& event) {
27 DCHECK(event->pointer_data); 26 DCHECK(event->pointer_data);
28 DCHECK_EQ(mus::mojom::PointerKind::MOUSE, event->pointer_data->kind); 27 DCHECK_EQ(mus::mojom::PointerKind::MOUSE, event->pointer_data->kind);
29 switch (event->action) { 28 switch (event->action) {
30 case mus::mojom::EventType::POINTER_DOWN: 29 case mus::mojom::EventType::POINTER_DOWN:
31 return ui::ET_MOUSE_PRESSED; 30 return ui::ET_MOUSE_PRESSED;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } break; 411 } break;
413 412
414 default: 413 default:
415 NOTIMPLEMENTED(); 414 NOTIMPLEMENTED();
416 } 415 }
417 // TODO: need to support time_stamp. 416 // TODO: need to support time_stamp.
418 return nullptr; 417 return nullptr;
419 } 418 }
420 419
421 } // namespace mojo 420 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698