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() |
| 13 : should_delete_instance_(false) { |
| 14 } |
| 15 |
| 16 DeviceDataManagerTestAPI::~DeviceDataManagerTestAPI() { |
| 17 if (should_delete_instance_) |
| 18 DeviceDataManager::DeleteInstance(); |
| 19 } |
| 20 |
| 21 bool DeviceDataManagerTestAPI::CreateDeviceDataManagerInstance() { |
| 22 should_delete_instance_ = true; |
| 23 DeviceDataManager::DeleteInstance(); |
| 24 DeviceDataManager::set_instance(new DeviceDataManager()); |
| 25 return true; |
| 26 } |
| 27 |
| 28 void DeviceDataManagerTestAPI:: |
| 29 NotifyObserversTouchscreenDeviceConfigurationChanged() { |
| 30 DeviceDataManager::GetInstance() |
| 31 ->NotifyObserversTouchscreenDeviceConfigurationChanged(); |
| 32 } |
| 33 |
| 34 void DeviceDataManagerTestAPI:: |
| 35 NotifyObserversKeyboardDeviceConfigurationChanged() { |
| 36 DeviceDataManager::GetInstance() |
| 37 ->NotifyObserversKeyboardDeviceConfigurationChanged(); |
| 38 } |
| 39 |
| 40 void DeviceDataManagerTestAPI:: |
| 41 NotifyObserversMouseDeviceConfigurationChanged() { |
| 42 DeviceDataManager::GetInstance() |
| 43 ->NotifyObserversMouseDeviceConfigurationChanged(); |
| 44 } |
| 45 |
| 46 void DeviceDataManagerTestAPI:: |
| 47 NotifyObserversTouchpadDeviceConfigurationChanged() { |
| 48 DeviceDataManager::GetInstance() |
| 49 ->NotifyObserversTouchpadDeviceConfigurationChanged(); |
| 50 } |
| 51 |
| 52 void DeviceDataManagerTestAPI::NotifyObserversDeviceListsComplete() { |
| 53 DeviceDataManager::GetInstance()->NotifyObserversDeviceListsComplete(); |
| 54 } |
| 55 |
| 56 void DeviceDataManagerTestAPI::OnDeviceListsComplete() { |
| 57 DeviceDataManager::GetInstance()->OnDeviceListsComplete(); |
| 58 } |
| 59 |
| 60 } // namespace test |
| 61 } // namespace ui |
OLD | NEW |