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

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 void DispatchGamepadEvent(const GamepadEvent& event) override {
90 event_factory_evdev_->DispatchGamepadEvent(event);
91 }
92
93 void DispatchGamepadDevicesUpdated(
94 const std::vector<InputDevice>& devices) override {
95 event_factory_evdev_->DispatchGamepadDevicesUpdated(devices);
96 }
97
88 private: 98 private:
89 EventFactoryEvdev* event_factory_evdev_; 99 EventFactoryEvdev* event_factory_evdev_;
90 }; 100 };
91 101
92 class TestEventFactoryEvdev : public EventFactoryEvdev { 102 class TestEventFactoryEvdev : public EventFactoryEvdev {
93 public: 103 public:
94 TestEventFactoryEvdev(CursorDelegateEvdev* cursor, 104 TestEventFactoryEvdev(CursorDelegateEvdev* cursor,
95 DeviceManager* device_manager, 105 DeviceManager* device_manager,
96 KeyboardLayoutEngine* keyboard_layout_engine, 106 KeyboardLayoutEngine* keyboard_layout_engine,
97 const EventDispatchCallback& callback) 107 const EventDispatchCallback& callback)
(...skipping 25 matching lines...) Expand all
123 std::unique_ptr<EventFactoryEvdev> CreateEventFactoryEvdevForTest( 133 std::unique_ptr<EventFactoryEvdev> CreateEventFactoryEvdevForTest(
124 CursorDelegateEvdev* cursor, 134 CursorDelegateEvdev* cursor,
125 DeviceManager* device_manager, 135 DeviceManager* device_manager,
126 KeyboardLayoutEngine* keyboard_layout_engine, 136 KeyboardLayoutEngine* keyboard_layout_engine,
127 const EventDispatchCallback& callback) { 137 const EventDispatchCallback& callback) {
128 return base::MakeUnique<TestEventFactoryEvdev>( 138 return base::MakeUnique<TestEventFactoryEvdev>(
129 cursor, device_manager, keyboard_layout_engine, callback); 139 cursor, device_manager, keyboard_layout_engine, callback);
130 } 140 }
131 141
132 } // namespace ui 142 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_converter_evdev.cc ('k') | ui/events/ozone/evdev/event_device_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698