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

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev_impl.h

Issue 872683006: [PATCH 3/11] ozone: evdev: Move MouseButtonMap usage during dispatch to EventFactoryEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update per comments on previous patches Created 5 years, 10 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
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/message_loop/message_pump_libevent.h" 11 #include "base/message_loop/message_pump_libevent.h"
12 #include "ui/events/devices/input_device.h" 12 #include "ui/events/devices/input_device.h"
13 #include "ui/events/event.h" 13 #include "ui/events/event.h"
14 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 14 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
15 #include "ui/events/ozone/evdev/event_converter_evdev.h" 15 #include "ui/events/ozone/evdev/event_converter_evdev.h"
16 #include "ui/events/ozone/evdev/event_device_info.h" 16 #include "ui/events/ozone/evdev/event_device_info.h"
17 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" 17 #include "ui/events/ozone/evdev/event_modifiers_evdev.h"
18 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" 18 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
19 #include "ui/events/ozone/evdev/keyboard_evdev.h" 19 #include "ui/events/ozone/evdev/keyboard_evdev.h"
20 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h" 20 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h"
21 21
22 struct input_event; 22 struct input_event;
23 23
24 namespace ui { 24 namespace ui {
25 25
26 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdevImpl 26 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdevImpl
27 : public EventConverterEvdev { 27 : public EventConverterEvdev {
28 public: 28 public:
29 EventConverterEvdevImpl(int fd, 29 EventConverterEvdevImpl(
30 base::FilePath path, 30 int fd,
31 int id, 31 base::FilePath path,
32 InputDeviceType type, 32 int id,
33 const EventDeviceInfo& info, 33 InputDeviceType type,
34 EventModifiersEvdev* modifiers, 34 const EventDeviceInfo& info,
35 MouseButtonMapEvdev* button_map, 35 EventModifiersEvdev* modifiers,
36 CursorDelegateEvdev* cursor, 36 CursorDelegateEvdev* cursor,
37 const KeyEventDispatchCallback& key_callback, 37 const KeyEventDispatchCallback& key_callback,
38 const EventDispatchCallback& callback); 38 const MouseMoveEventDispatchCallback& mouse_move_callback,
39 const MouseButtonEventDispatchCallback& mouse_button_callback);
39 ~EventConverterEvdevImpl() override; 40 ~EventConverterEvdevImpl() override;
40 41
41 // EventConverterEvdev: 42 // EventConverterEvdev:
42 void OnFileCanReadWithoutBlocking(int fd) override; 43 void OnFileCanReadWithoutBlocking(int fd) override;
43 bool HasKeyboard() const override; 44 bool HasKeyboard() const override;
44 bool HasTouchpad() const override; 45 bool HasTouchpad() const override;
45 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override; 46 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override;
46 void AllowAllKeys() override; 47 void AllowAllKeys() override;
47 48
48 void ProcessEvents(const struct input_event* inputs, int count); 49 void ProcessEvents(const struct input_event* inputs, int count);
(...skipping 25 matching lines...) Expand all
74 // The keys which should be processed. nullptr if all keys should be 75 // The keys which should be processed. nullptr if all keys should be
75 // processed. 76 // processed.
76 scoped_ptr<std::set<DomCode>> allowed_keys_; 77 scoped_ptr<std::set<DomCode>> allowed_keys_;
77 78
78 // Shared cursor state. 79 // Shared cursor state.
79 CursorDelegateEvdev* cursor_; 80 CursorDelegateEvdev* cursor_;
80 81
81 // Modifier key state (shift, ctrl, etc). 82 // Modifier key state (shift, ctrl, etc).
82 EventModifiersEvdev* modifiers_; 83 EventModifiersEvdev* modifiers_;
83 84
84 // Shared mouse button map.
85 MouseButtonMapEvdev* button_map_;
86
87 // Callbacks for dispatching events. 85 // Callbacks for dispatching events.
88 KeyEventDispatchCallback key_callback_; 86 KeyEventDispatchCallback key_callback_;
89 EventDispatchCallback callback_; 87 MouseMoveEventDispatchCallback mouse_move_callback_;
88 MouseButtonEventDispatchCallback mouse_button_callback_;
90 89
91 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl); 90 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl);
92 }; 91 };
93 92
94 } // namespace ui 93 } // namespace ui
95 94
96 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ 95 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
97 96
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698