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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 event_factory_evdev_, params)); | 78 event_factory_evdev_, params)); |
79 } | 79 } |
80 | 80 |
81 void DispatchTouchEvent(const TouchEventParams& params) override { | 81 void DispatchTouchEvent(const TouchEventParams& params) override { |
82 ui_thread_runner_->PostTask( | 82 ui_thread_runner_->PostTask( |
83 FROM_HERE, base::Bind(&EventFactoryEvdev::DispatchTouchEvent, | 83 FROM_HERE, base::Bind(&EventFactoryEvdev::DispatchTouchEvent, |
84 event_factory_evdev_, params)); | 84 event_factory_evdev_, params)); |
85 } | 85 } |
86 | 86 |
87 void DispatchKeyboardDevicesUpdated( | 87 void DispatchKeyboardDevicesUpdated( |
88 const std::vector<KeyboardDevice>& devices) override { | 88 const std::vector<InputDevice>& devices) override { |
89 ui_thread_runner_->PostTask( | 89 ui_thread_runner_->PostTask( |
90 FROM_HERE, | 90 FROM_HERE, |
91 base::Bind(&EventFactoryEvdev::DispatchKeyboardDevicesUpdated, | 91 base::Bind(&EventFactoryEvdev::DispatchKeyboardDevicesUpdated, |
92 event_factory_evdev_, devices)); | 92 event_factory_evdev_, devices)); |
93 } | 93 } |
94 void DispatchTouchscreenDevicesUpdated( | 94 void DispatchTouchscreenDevicesUpdated( |
95 const std::vector<TouchscreenDevice>& devices) override { | 95 const std::vector<TouchscreenDevice>& devices) override { |
96 ui_thread_runner_->PostTask( | 96 ui_thread_runner_->PostTask( |
97 FROM_HERE, | 97 FROM_HERE, |
98 base::Bind(&EventFactoryEvdev::DispatchTouchscreenDevicesUpdated, | 98 base::Bind(&EventFactoryEvdev::DispatchTouchscreenDevicesUpdated, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 void EventFactoryEvdev::DispatchUiEvent(Event* event) { | 315 void EventFactoryEvdev::DispatchUiEvent(Event* event) { |
316 // DispatchEvent takes PlatformEvent which is void*. This function | 316 // DispatchEvent takes PlatformEvent which is void*. This function |
317 // wraps it with the real type. | 317 // wraps it with the real type. |
318 DispatchEvent(event); | 318 DispatchEvent(event); |
319 } | 319 } |
320 | 320 |
321 void EventFactoryEvdev::DispatchKeyboardDevicesUpdated( | 321 void EventFactoryEvdev::DispatchKeyboardDevicesUpdated( |
322 const std::vector<KeyboardDevice>& devices) { | 322 const std::vector<InputDevice>& devices) { |
323 TRACE_EVENT0("evdev", "EventFactoryEvdev::DispatchKeyboardDevicesUpdated"); | 323 TRACE_EVENT0("evdev", "EventFactoryEvdev::DispatchKeyboardDevicesUpdated"); |
324 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); | 324 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
325 observer->OnKeyboardDevicesUpdated(devices); | 325 observer->OnKeyboardDevicesUpdated(devices); |
326 } | 326 } |
327 | 327 |
328 void EventFactoryEvdev::DispatchTouchscreenDevicesUpdated( | 328 void EventFactoryEvdev::DispatchTouchscreenDevicesUpdated( |
329 const std::vector<TouchscreenDevice>& devices) { | 329 const std::vector<TouchscreenDevice>& devices) { |
330 TRACE_EVENT0("evdev", "EventFactoryEvdev::DispatchTouchscreenDevicesUpdated"); | 330 TRACE_EVENT0("evdev", "EventFactoryEvdev::DispatchTouchscreenDevicesUpdated"); |
331 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); | 331 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
332 observer->OnTouchscreenDevicesUpdated(devices); | 332 observer->OnTouchscreenDevicesUpdated(devices); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 425 |
426 // Scan & monitor devices. | 426 // Scan & monitor devices. |
427 device_manager_->AddObserver(this); | 427 device_manager_->AddObserver(this); |
428 device_manager_->ScanDevices(this); | 428 device_manager_->ScanDevices(this); |
429 | 429 |
430 // Notify device thread that initial scan is done. | 430 // Notify device thread that initial scan is done. |
431 input_device_factory_proxy_->OnStartupScanComplete(); | 431 input_device_factory_proxy_->OnStartupScanComplete(); |
432 } | 432 } |
433 | 433 |
434 } // namespace ui | 434 } // namespace ui |
OLD | NEW |