OLD | NEW |
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 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 5 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/task_runner.h" | 8 #include "base/task_runner.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "base/threading/worker_pool.h" | 10 #include "base/threading/worker_pool.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 scoped_ptr<DeviceEventDispatcherEvdev> proxy_dispatcher( | 145 scoped_ptr<DeviceEventDispatcherEvdev> proxy_dispatcher( |
146 new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(), | 146 new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(), |
147 weak_ptr_factory_.GetWeakPtr())); | 147 weak_ptr_factory_.GetWeakPtr())); |
148 return make_scoped_ptr( | 148 return make_scoped_ptr( |
149 new InputInjectorEvdev(proxy_dispatcher.Pass(), cursor_)); | 149 new InputInjectorEvdev(proxy_dispatcher.Pass(), cursor_)); |
150 } | 150 } |
151 | 151 |
152 void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) { | 152 void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) { |
153 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchKeyEvent", "device", | 153 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchKeyEvent", "device", |
154 params.device_id); | 154 params.device_id); |
155 keyboard_.OnKeyChange(params.code, params.down, params.timestamp, | 155 keyboard_.OnKeyChange(params.code, params.down, params.timestamp); |
156 params.device_id); | |
157 } | 156 } |
158 | 157 |
159 void EventFactoryEvdev::DispatchMouseMoveEvent( | 158 void EventFactoryEvdev::DispatchMouseMoveEvent( |
160 const MouseMoveEventParams& params) { | 159 const MouseMoveEventParams& params) { |
161 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchMouseMoveEvent", "device", | 160 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchMouseMoveEvent", "device", |
162 params.device_id); | 161 params.device_id); |
163 MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location, | 162 MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location, |
164 params.timestamp, modifiers_.GetModifierFlags(), | 163 params.timestamp, modifiers_.GetModifierFlags(), |
165 /* changed_button_flags */ 0); | 164 /* changed_button_flags */ 0); |
166 event.set_source_device_id(params.device_id); | 165 event.set_source_device_id(params.device_id); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 365 |
367 // Hook up device configuration. | 366 // Hook up device configuration. |
368 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); | 367 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); |
369 | 368 |
370 // Scan & monitor devices. | 369 // Scan & monitor devices. |
371 device_manager_->AddObserver(this); | 370 device_manager_->AddObserver(this); |
372 device_manager_->ScanDevices(this); | 371 device_manager_->ScanDevices(this); |
373 } | 372 } |
374 | 373 |
375 } // namespace ui | 374 } // namespace ui |
OLD | NEW |