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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // directly. We cannot assume it is safe to (re-)enter ui::Event dispatch | 143 // directly. We cannot assume it is safe to (re-)enter ui::Event dispatch |
144 // synchronously from the injection point. | 144 // synchronously from the injection point. |
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 keyboard_.OnKeyChange(params.code, params.down, params.timestamp, | 153 keyboard_.OnKeyChange(params.code, params.down, params.timestamp); |
154 params.device_id); | |
155 } | 154 } |
156 | 155 |
157 void EventFactoryEvdev::DispatchMouseMoveEvent( | 156 void EventFactoryEvdev::DispatchMouseMoveEvent( |
158 const MouseMoveEventParams& params) { | 157 const MouseMoveEventParams& params) { |
159 MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location, | 158 MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location, |
160 params.timestamp, modifiers_.GetModifierFlags(), | 159 params.timestamp, modifiers_.GetModifierFlags(), |
161 /* changed_button_flags */ 0); | 160 /* changed_button_flags */ 0); |
162 event.set_source_device_id(params.device_id); | 161 event.set_source_device_id(params.device_id); |
163 DispatchUiEvent(&event); | 162 DispatchUiEvent(&event); |
164 } | 163 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 342 |
344 // Hook up device configuration. | 343 // Hook up device configuration. |
345 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); | 344 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); |
346 | 345 |
347 // Scan & monitor devices. | 346 // Scan & monitor devices. |
348 device_manager_->AddObserver(this); | 347 device_manager_->AddObserver(this); |
349 device_manager_->ScanDevices(this); | 348 device_manager_->ScanDevices(this); |
350 } | 349 } |
351 | 350 |
352 } // namespace ui | 351 } // namespace ui |
OLD | NEW |