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 accessible by DeviceDataManager::GetInstance(). If | |
23 // |delete_instance| is true then DeviceDataManager::DeleteInstance() will be | |
24 // called during the destructor. | |
25 explicit DeviceDataManagerTestAPI(bool delete_instance); | |
26 | |
27 // Will call DeviceDataManager::DeleteInstance() if |delete_instance_| is | |
28 // true. | |
29 ~DeviceDataManagerTestAPI(); | |
30 | |
31 // Creates a new ui::DeviceDataManager and sets it as the global instance. | |
32 // i.e. It is accessible via ui::DeviceDataManager::GetInstance(). If the | |
33 // DeviceDataManager already owns an instance it will be deleted using | |
34 // DeviceDataManager::DeleteInstance(). | |
35 // | |
36 // Note: The ui::DeviceDataManager is not available on all platforms, thus | |
37 // this returns true when it is possible to instantiate a | |
38 // ui::DeviceDataManager instance and false otherwise. | |
39 bool CreateDeviceDataManagerInstance(); | |
sadrul
2015/07/10 21:57:34
Why does delete_instance need to be passed-in to t
bruthig
2015/07/10 22:27:28
Done.
| |
40 | |
41 // Wrapper functions to DeviceDataManager. | |
42 void NotifyObserversTouchscreenDeviceConfigurationChanged(); | |
43 void NotifyObserversKeyboardDeviceConfigurationChanged(); | |
44 void NotifyObserversMouseDeviceConfigurationChanged(); | |
45 void NotifyObserversTouchpadDeviceConfigurationChanged(); | |
46 void NotifyObserversDeviceListsComplete(); | |
47 void OnDeviceListsComplete(); | |
48 | |
49 private: | |
50 // Tracks whether DeviceDataManager::DeleteInstance() should be called during | |
51 // destruction. | |
52 bool delete_instance_; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerTestAPI); | |
55 }; | |
56 | |
57 } // namespace test | |
58 } // namespace ui | |
59 | |
60 #endif // UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_ | |
OLD | NEW |