| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // directly. We cannot assume it is safe to (re-)enter ui::Event dispatch | 141 // directly. We cannot assume it is safe to (re-)enter ui::Event dispatch |
| 142 // synchronously from the injection point. | 142 // synchronously from the injection point. |
| 143 scoped_ptr<DeviceEventDispatcherEvdev> proxy_dispatcher( | 143 scoped_ptr<DeviceEventDispatcherEvdev> proxy_dispatcher( |
| 144 new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(), | 144 new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(), |
| 145 weak_ptr_factory_.GetWeakPtr())); | 145 weak_ptr_factory_.GetWeakPtr())); |
| 146 return make_scoped_ptr( | 146 return make_scoped_ptr( |
| 147 new InputInjectorEvdev(proxy_dispatcher.Pass(), cursor_)); | 147 new InputInjectorEvdev(proxy_dispatcher.Pass(), cursor_)); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) { | 150 void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) { |
| 151 keyboard_.OnKeyChange(params.code, params.down, params.timestamp); | 151 keyboard_.OnKeyChange(params.code, params.down, params.timestamp, |
| 152 params.device_id); |
| 152 } | 153 } |
| 153 | 154 |
| 154 void EventFactoryEvdev::DispatchMouseMoveEvent( | 155 void EventFactoryEvdev::DispatchMouseMoveEvent( |
| 155 const MouseMoveEventParams& params) { | 156 const MouseMoveEventParams& params) { |
| 156 MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location, | 157 MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location, |
| 157 params.timestamp, modifiers_.GetModifierFlags(), | 158 params.timestamp, modifiers_.GetModifierFlags(), |
| 158 /* changed_button_flags */ 0); | 159 /* changed_button_flags */ 0); |
| 159 event.set_source_device_id(params.device_id); | 160 event.set_source_device_id(params.device_id); |
| 160 DispatchUiEvent(&event); | 161 DispatchUiEvent(&event); |
| 161 } | 162 } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 334 |
| 334 // Hook up device configuration. | 335 // Hook up device configuration. |
| 335 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); | 336 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); |
| 336 | 337 |
| 337 // Scan & monitor devices. | 338 // Scan & monitor devices. |
| 338 device_manager_->AddObserver(this); | 339 device_manager_->AddObserver(this); |
| 339 device_manager_->ScanDevices(this); | 340 device_manager_->ScanDevices(this); |
| 340 } | 341 } |
| 341 | 342 |
| 342 } // namespace ui | 343 } // namespace ui |
| OLD | NEW |