| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 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/test/device_data_manager_test_api.h" |
| 6 |
| 7 #include "ui/events/devices/device_data_manager.h" |
| 8 |
| 9 namespace ui { |
| 10 namespace test { |
| 11 |
| 12 DeviceDataManagerTestAPI::DeviceDataManagerTestAPI(bool delete_instance) |
| 13 : delete_instance_(delete_instance) { |
| 14 } |
| 15 |
| 16 DeviceDataManagerTestAPI::~DeviceDataManagerTestAPI() { |
| 17 if (delete_instance_) |
| 18 DeviceDataManager::DeleteInstance(); |
| 19 } |
| 20 |
| 21 bool DeviceDataManagerTestAPI::CreateDeviceDataManagerInstance() { |
| 22 DeviceDataManager::DeleteInstance(); |
| 23 DeviceDataManager::set_instance(new DeviceDataManager()); |
| 24 return true; |
| 25 } |
| 26 |
| 27 void DeviceDataManagerTestAPI:: |
| 28 NotifyObserversTouchscreenDeviceConfigurationChanged() { |
| 29 DeviceDataManager::GetInstance() |
| 30 ->NotifyObserversTouchscreenDeviceConfigurationChanged(); |
| 31 } |
| 32 |
| 33 void DeviceDataManagerTestAPI:: |
| 34 NotifyObserversKeyboardDeviceConfigurationChanged() { |
| 35 DeviceDataManager::GetInstance() |
| 36 ->NotifyObserversKeyboardDeviceConfigurationChanged(); |
| 37 } |
| 38 |
| 39 void DeviceDataManagerTestAPI:: |
| 40 NotifyObserversMouseDeviceConfigurationChanged() { |
| 41 DeviceDataManager::GetInstance() |
| 42 ->NotifyObserversMouseDeviceConfigurationChanged(); |
| 43 } |
| 44 |
| 45 void DeviceDataManagerTestAPI:: |
| 46 NotifyObserversTouchpadDeviceConfigurationChanged() { |
| 47 DeviceDataManager::GetInstance() |
| 48 ->NotifyObserversTouchpadDeviceConfigurationChanged(); |
| 49 } |
| 50 |
| 51 void DeviceDataManagerTestAPI::NotifyObserversDeviceListsComplete() { |
| 52 DeviceDataManager::GetInstance()->NotifyObserversDeviceListsComplete(); |
| 53 } |
| 54 |
| 55 void DeviceDataManagerTestAPI::OnDeviceListsComplete() { |
| 56 DeviceDataManager::GetInstance()->OnDeviceListsComplete(); |
| 57 } |
| 58 |
| 59 } // namespace test |
| 60 } // namespace ui |
| OLD | NEW |