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 #ifndef UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_ |
| 6 #define UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/events/devices/events_devices_export.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 class DeviceDataManager; |
| 15 |
| 16 namespace test { |
| 17 |
| 18 // Test API class to access internals of the DeviceDataManager class. |
| 19 class DeviceDataManagerTestAPI { |
| 20 public: |
| 21 // Constructs a test api that provides access to the global DeviceDataManager |
| 22 // instance that is accessible by DeviceDataManager::GetInstance(). |
| 23 DeviceDataManagerTestAPI(); |
| 24 |
| 25 // Will call DeviceDataManager::DeleteInstance() if |
| 26 // CreateDeviceDataManagerInstance() was used to create a new instance. |
| 27 ~DeviceDataManagerTestAPI(); |
| 28 |
| 29 // Creates a new ui::DeviceDataManager and sets it as the global instance. |
| 30 // i.e. It is accessible via ui::DeviceDataManager::GetInstance(). If the |
| 31 // DeviceDataManager already owns an instance it will be deleted using |
| 32 // DeviceDataManager::DeleteInstance(). |
| 33 // |
| 34 // Note: The ui::DeviceDataManager is not available on all platforms, thus |
| 35 // this returns true when it is possible to instantiate a |
| 36 // ui::DeviceDataManager instance and false otherwise. |
| 37 bool CreateDeviceDataManagerInstance(); |
| 38 |
| 39 // Wrapper functions to DeviceDataManager. |
| 40 void NotifyObserversTouchscreenDeviceConfigurationChanged(); |
| 41 void NotifyObserversKeyboardDeviceConfigurationChanged(); |
| 42 void NotifyObserversMouseDeviceConfigurationChanged(); |
| 43 void NotifyObserversTouchpadDeviceConfigurationChanged(); |
| 44 void NotifyObserversDeviceListsComplete(); |
| 45 void OnDeviceListsComplete(); |
| 46 |
| 47 private: |
| 48 // Tracks whether DeviceDataManager::DeleteInstance() should be called during |
| 49 // destruction. |
| 50 bool should_delete_instance_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerTestAPI); |
| 53 }; |
| 54 |
| 55 } // namespace test |
| 56 } // namespace ui |
| 57 |
| 58 #endif // UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_ |
OLD | NEW |