| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void EventFactoryEvdev::DispatchTouchscreenDevicesUpdated( | 247 void EventFactoryEvdev::DispatchTouchscreenDevicesUpdated( |
| 248 const std::vector<TouchscreenDevice>& devices) { | 248 const std::vector<TouchscreenDevice>& devices) { |
| 249 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); | 249 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
| 250 observer->OnTouchscreenDevicesUpdated(devices); | 250 observer->OnTouchscreenDevicesUpdated(devices); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void EventFactoryEvdev::DispatchMouseDevicesUpdated( | 253 void EventFactoryEvdev::DispatchMouseDevicesUpdated( |
| 254 const std::vector<InputDevice>& devices) { | 254 const std::vector<InputDevice>& devices) { |
| 255 // There's no list of mice in DeviceDataManager. | 255 // There's no list of mice in DeviceDataManager. |
| 256 input_controller_.set_has_mouse(devices.size() != 0); | 256 input_controller_.set_has_mouse(devices.size() != 0); |
| 257 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
| 258 observer->OnMouseDevicesUpdated(devices); |
| 257 } | 259 } |
| 258 | 260 |
| 259 void EventFactoryEvdev::DispatchTouchpadDevicesUpdated( | 261 void EventFactoryEvdev::DispatchTouchpadDevicesUpdated( |
| 260 const std::vector<InputDevice>& devices) { | 262 const std::vector<InputDevice>& devices) { |
| 261 // There's no list of touchpads in DeviceDataManager. | 263 // There's no list of touchpads in DeviceDataManager. |
| 262 input_controller_.set_has_touchpad(devices.size() != 0); | 264 input_controller_.set_has_touchpad(devices.size() != 0); |
| 265 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
| 266 observer->OnTouchpadDevicesUpdated(devices); |
| 263 } | 267 } |
| 264 | 268 |
| 265 | 269 |
| 266 void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) { | 270 void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) { |
| 267 if (event.device_type() != DeviceEvent::INPUT) | 271 if (event.device_type() != DeviceEvent::INPUT) |
| 268 return; | 272 return; |
| 269 | 273 |
| 270 switch (event.action_type()) { | 274 switch (event.action_type()) { |
| 271 case DeviceEvent::ADD: | 275 case DeviceEvent::ADD: |
| 272 case DeviceEvent::CHANGE: { | 276 case DeviceEvent::CHANGE: { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 325 |
| 322 // TODO(spang): This settings interface is really broken. crbug.com/450899 | 326 // TODO(spang): This settings interface is really broken. crbug.com/450899 |
| 323 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); | 327 input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); |
| 324 | 328 |
| 325 // Scan & monitor devices. | 329 // Scan & monitor devices. |
| 326 device_manager_->AddObserver(this); | 330 device_manager_->AddObserver(this); |
| 327 device_manager_->ScanDevices(this); | 331 device_manager_->ScanDevices(this); |
| 328 } | 332 } |
| 329 | 333 |
| 330 } // namespace ui | 334 } // namespace ui |
| OLD | NEW |