1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "ui/events/devices/device_data_manager_test_api.h" 6 7 #include "ui/events/devices/device_data_manager.h" 8 #include "ui/events/devices/input_device.h" 9 #include "ui/events/devices/touchscreen_device.h" 10 11 namespace ui { 12 13 DeviceDataManagerTestApi::DeviceDataManagerTestApi() = default; 14 15 DeviceDataManagerTestApi::~DeviceDataManagerTestApi() = default; 16 NotifyObserversDeviceListsComplete()17void DeviceDataManagerTestApi::NotifyObserversDeviceListsComplete() { 18 DeviceDataManager::instance_->NotifyObserversDeviceListsComplete(); 19 } 20 21 void DeviceDataManagerTestApi:: NotifyObserversKeyboardDeviceConfigurationChanged()22 NotifyObserversKeyboardDeviceConfigurationChanged() { 23 DeviceDataManager::instance_ 24 ->NotifyObserversKeyboardDeviceConfigurationChanged(); 25 } 26 NotifyObserversStylusStateChanged(StylusState stylus_state)27void DeviceDataManagerTestApi::NotifyObserversStylusStateChanged( 28 StylusState stylus_state) { 29 DeviceDataManager::instance_->NotifyObserversStylusStateChanged(stylus_state); 30 } 31 32 void DeviceDataManagerTestApi:: NotifyObserversTouchscreenDeviceConfigurationChanged()33 NotifyObserversTouchscreenDeviceConfigurationChanged() { 34 DeviceDataManager::instance_ 35 ->NotifyObserversTouchscreenDeviceConfigurationChanged(); 36 } 37 38 void DeviceDataManagerTestApi:: NotifyObserversTouchpadDeviceConfigurationChanged()39 NotifyObserversTouchpadDeviceConfigurationChanged() { 40 DeviceDataManager::instance_ 41 ->NotifyObserversTouchpadDeviceConfigurationChanged(); 42 } 43 OnDeviceListsComplete()44void DeviceDataManagerTestApi::OnDeviceListsComplete() { 45 DeviceDataManager::instance_->OnDeviceListsComplete(); 46 } 47 SetKeyboardDevices(const std::vector<InputDevice> & devices)48void DeviceDataManagerTestApi::SetKeyboardDevices( 49 const std::vector<InputDevice>& devices) { 50 DeviceDataManager::instance_->OnKeyboardDevicesUpdated(devices); 51 } 52 SetMouseDevices(const std::vector<InputDevice> & devices)53void DeviceDataManagerTestApi::SetMouseDevices( 54 const std::vector<InputDevice>& devices) { 55 DeviceDataManager::instance_->OnMouseDevicesUpdated(devices); 56 } 57 SetTouchscreenDevices(const std::vector<TouchscreenDevice> & devices,bool are_touchscreen_target_displays_valid)58void DeviceDataManagerTestApi::SetTouchscreenDevices( 59 const std::vector<TouchscreenDevice>& devices, 60 bool are_touchscreen_target_displays_valid) { 61 DeviceDataManager::instance_->OnTouchscreenDevicesUpdated(devices); 62 } 63 SetTouchpadDevices(const std::vector<InputDevice> & devices)64void DeviceDataManagerTestApi::SetTouchpadDevices( 65 const std::vector<InputDevice>& devices) { 66 DeviceDataManager::instance_->OnTouchpadDevicesUpdated(devices); 67 } 68 SetUncategorizedDevices(const std::vector<InputDevice> & devices)69void DeviceDataManagerTestApi::SetUncategorizedDevices( 70 const std::vector<InputDevice>& devices) { 71 DeviceDataManager::instance_->OnUncategorizedDevicesUpdated(devices); 72 } 73 74 } // namespace ui 75