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

Side by Side Diff: ui/events/ozone/evdev/event_converter_test_util.cc

Issue 2805793002: ozone: evdev: Add gamepad support (Closed)
Patch Set: Support Gamepad in Ozone. Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ozone/evdev/event_converter_test_util.h" 5 #include "ui/events/ozone/evdev/event_converter_test_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "ui/events/ozone/device/device_manager.h" 10 #include "ui/events/ozone/device/device_manager.h"
(...skipping 16 matching lines...) Expand all
27 void RemoveObserver(DeviceEventObserver* observer) override {} 27 void RemoveObserver(DeviceEventObserver* observer) override {}
28 }; 28 };
29 29
30 class TestDeviceEventDispatcherEvdev : public DeviceEventDispatcherEvdev { 30 class TestDeviceEventDispatcherEvdev : public DeviceEventDispatcherEvdev {
31 public: 31 public:
32 TestDeviceEventDispatcherEvdev(EventFactoryEvdev* event_factory_evdev) 32 TestDeviceEventDispatcherEvdev(EventFactoryEvdev* event_factory_evdev)
33 : event_factory_evdev_(event_factory_evdev) {} 33 : event_factory_evdev_(event_factory_evdev) {}
34 ~TestDeviceEventDispatcherEvdev() override {} 34 ~TestDeviceEventDispatcherEvdev() override {}
35 35
36 // DeviceEventDispatcher: 36 // DeviceEventDispatcher:
37
37 void DispatchKeyEvent(const KeyEventParams& params) override { 38 void DispatchKeyEvent(const KeyEventParams& params) override {
38 event_factory_evdev_->DispatchKeyEvent(params); 39 event_factory_evdev_->DispatchKeyEvent(params);
39 } 40 }
40 41
41 void DispatchMouseMoveEvent(const MouseMoveEventParams& params) override { 42 void DispatchMouseMoveEvent(const MouseMoveEventParams& params) override {
42 event_factory_evdev_->DispatchMouseMoveEvent(params); 43 event_factory_evdev_->DispatchMouseMoveEvent(params);
43 } 44 }
44 45
45 void DispatchMouseButtonEvent(const MouseButtonEventParams& params) override { 46 void DispatchMouseButtonEvent(const MouseButtonEventParams& params) override {
46 event_factory_evdev_->DispatchMouseButtonEvent(params); 47 event_factory_evdev_->DispatchMouseButtonEvent(params);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const std::vector<InputDevice>& devices) override { 79 const std::vector<InputDevice>& devices) override {
79 event_factory_evdev_->DispatchTouchpadDevicesUpdated(devices); 80 event_factory_evdev_->DispatchTouchpadDevicesUpdated(devices);
80 } 81 }
81 void DispatchDeviceListsComplete() override { 82 void DispatchDeviceListsComplete() override {
82 event_factory_evdev_->DispatchDeviceListsComplete(); 83 event_factory_evdev_->DispatchDeviceListsComplete();
83 } 84 }
84 void DispatchStylusStateChanged(StylusState stylus_state) override { 85 void DispatchStylusStateChanged(StylusState stylus_state) override {
85 event_factory_evdev_->DispatchStylusStateChanged(stylus_state); 86 event_factory_evdev_->DispatchStylusStateChanged(stylus_state);
86 } 87 }
87 88
89 // Dispatch Gamepad Event.
scottmg 2017/05/01 18:20:51 I don't think this comment is helping anyone, give
jkwang 2017/05/01 22:21:56 Done.
90 void DispatchGamepadEvent(const GamepadEvent& event) override {
91 event_factory_evdev_->DispatchGamepadEvent(event);
92 }
93
94 void DispatchGamepadDevicesUpdated(
95 const std::vector<InputDevice>& devices) override {
96 event_factory_evdev_->DispatchGamepadDevicesUpdated(devices);
97 }
98
88 private: 99 private:
89 EventFactoryEvdev* event_factory_evdev_; 100 EventFactoryEvdev* event_factory_evdev_;
90 }; 101 };
91 102
92 class TestEventFactoryEvdev : public EventFactoryEvdev { 103 class TestEventFactoryEvdev : public EventFactoryEvdev {
93 public: 104 public:
94 TestEventFactoryEvdev(CursorDelegateEvdev* cursor, 105 TestEventFactoryEvdev(CursorDelegateEvdev* cursor,
95 DeviceManager* device_manager, 106 DeviceManager* device_manager,
96 KeyboardLayoutEngine* keyboard_layout_engine, 107 KeyboardLayoutEngine* keyboard_layout_engine,
97 const EventDispatchCallback& callback) 108 const EventDispatchCallback& callback)
(...skipping 25 matching lines...) Expand all
123 std::unique_ptr<EventFactoryEvdev> CreateEventFactoryEvdevForTest( 134 std::unique_ptr<EventFactoryEvdev> CreateEventFactoryEvdevForTest(
124 CursorDelegateEvdev* cursor, 135 CursorDelegateEvdev* cursor,
125 DeviceManager* device_manager, 136 DeviceManager* device_manager,
126 KeyboardLayoutEngine* keyboard_layout_engine, 137 KeyboardLayoutEngine* keyboard_layout_engine,
127 const EventDispatchCallback& callback) { 138 const EventDispatchCallback& callback) {
128 return base::MakeUnique<TestEventFactoryEvdev>( 139 return base::MakeUnique<TestEventFactoryEvdev>(
129 cursor, device_manager, keyboard_layout_engine, callback); 140 cursor, device_manager, keyboard_layout_engine, callback);
130 } 141 }
131 142
132 } // namespace ui 143 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698