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

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

Issue 806693009: Port ScopedDisableInternalMouseAndKeyboardX11 to Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 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_FACTORY_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_
7 7
8 #include <set>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/callback.h" 11 #include "base/callback.h"
11 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
12 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
13 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
14 #include "base/task_runner.h" 15 #include "base/task_runner.h"
15 #include "ui/events/ozone/device/device_event_observer.h" 16 #include "ui/events/ozone/device/device_event_observer.h"
16 #include "ui/events/ozone/evdev/event_converter_evdev.h" 17 #include "ui/events/ozone/evdev/event_converter_evdev.h"
17 #include "ui/events/ozone/evdev/event_device_info.h" 18 #include "ui/events/ozone/evdev/event_device_info.h"
18 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" 19 #include "ui/events/ozone/evdev/event_modifiers_evdev.h"
19 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" 20 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
20 #include "ui/events/ozone/evdev/input_controller_evdev.h" 21 #include "ui/events/ozone/evdev/input_controller_evdev.h"
21 #include "ui/events/ozone/evdev/keyboard_evdev.h" 22 #include "ui/events/ozone/evdev/keyboard_evdev.h"
22 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h" 23 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h"
23 #include "ui/events/platform/platform_event_source.h" 24 #include "ui/events/platform/platform_event_source.h"
24 #include "ui/gfx/native_widget_types.h" 25 #include "ui/gfx/native_widget_types.h"
25 #include "ui/ozone/public/system_input_injector.h" 26 #include "ui/ozone/public/system_input_injector.h"
26 27
27 namespace gfx { 28 namespace gfx {
28 class PointF; 29 class PointF;
29 } // namespace gfx 30 } // namespace gfx
30 31
31 namespace ui { 32 namespace ui {
32 33
33 class CursorDelegateEvdev; 34 class CursorDelegateEvdev;
34 class DeviceManager; 35 class DeviceManager;
35 class SystemInputInjector; 36 class SystemInputInjector;
37 enum class DomCode;
36 38
37 #if !defined(USE_EVDEV) 39 #if !defined(USE_EVDEV)
38 #error Missing dependency on ui/events/ozone:events_ozone_evdev 40 #error Missing dependency on ui/events/ozone:events_ozone_evdev
39 #endif 41 #endif
40 42
41 #if defined(USE_EVDEV_GESTURES) 43 #if defined(USE_EVDEV_GESTURES)
42 class GesturePropertyProvider; 44 class GesturePropertyProvider;
43 #endif 45 #endif
44 46
45 // Ozone events implementation for the Linux input subsystem ("evdev"). 47 // Ozone events implementation for the Linux input subsystem ("evdev").
46 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver, 48 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver,
47 public PlatformEventSource { 49 public PlatformEventSource {
48 public: 50 public:
49 EventFactoryEvdev(CursorDelegateEvdev* cursor, 51 EventFactoryEvdev(CursorDelegateEvdev* cursor,
50 DeviceManager* device_manager, 52 DeviceManager* device_manager,
51 KeyboardLayoutEngine* keyboard_layout_engine); 53 KeyboardLayoutEngine* keyboard_layout_engine);
52 ~EventFactoryEvdev() override; 54 ~EventFactoryEvdev() override;
53 55
54 // Get a list of device ids that matches a device type. Return true if the 56 // Get a list of device ids that matches a device type. Return true if the
55 // list is not empty. |device_ids| can be NULL. 57 // list is not empty. |device_ids| can be NULL.
56 bool GetDeviceIdsByType(const EventDeviceType type, 58 bool GetDeviceIdsByType(const EventDeviceType type,
57 std::vector<int>* device_ids); 59 std::vector<int>* device_ids);
58 60
59 void WarpCursorTo(gfx::AcceleratedWidget widget, 61 void WarpCursorTo(gfx::AcceleratedWidget widget,
60 const gfx::PointF& location); 62 const gfx::PointF& location);
61 63
64 // Disables the internal touchpad.
65 void DisableInternalTouchpad();
66
67 // Enables the internal touchpad.
68 void EnableInternalTouchpad();
69
70 // Disables all keys on the internal keyboard except |excepted_keys|.
71 void DisableInternalKeyboardExceptKeys(
72 scoped_ptr<std::set<DomCode>> excepted_keys);
73
74 // Enables all keys on the internal keyboard.
75 void EnableInternalKeyboard();
76
62 scoped_ptr<SystemInputInjector> CreateSystemInputInjector(); 77 scoped_ptr<SystemInputInjector> CreateSystemInputInjector();
63 78
64 InputController* input_controller() { return &input_controller_; } 79 InputController* input_controller() { return &input_controller_; }
65 80
66 protected: 81 protected:
67 // DeviceEventObserver overrides: 82 // DeviceEventObserver overrides:
68 // 83 //
69 // Callback for device add (on UI thread). 84 // Callback for device add (on UI thread).
70 void OnDeviceEvent(const DeviceEvent& event) override; 85 void OnDeviceEvent(const DeviceEvent& event) override;
71 86
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 144
130 // Support weak pointers for attach & detach callbacks. 145 // Support weak pointers for attach & detach callbacks.
131 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; 146 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_;
132 147
133 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); 148 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev);
134 }; 149 };
135 150
136 } // namespace ui 151 } // namespace ui
137 152
138 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ 153 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698