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.
5 #ifndef UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_
6 #define UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/events/devices/events_devices_export.h"
14 class DeviceDataManager
;
18 // Test API class to access internals of the DeviceDataManager class.
19 class DeviceDataManagerTestAPI
{
21 // Constructs a test api that provides access to the global DeviceDataManager
22 // instance that is accessible by DeviceDataManager::GetInstance().
23 DeviceDataManagerTestAPI();
25 // Will call DeviceDataManager::DeleteInstance() if
26 // CreateDeviceDataManagerInstance() was used to create a new instance.
27 ~DeviceDataManagerTestAPI();
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().
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();
39 // Wrapper functions to DeviceDataManager.
40 void NotifyObserversTouchscreenDeviceConfigurationChanged();
41 void NotifyObserversKeyboardDeviceConfigurationChanged();
42 void NotifyObserversMouseDeviceConfigurationChanged();
43 void NotifyObserversTouchpadDeviceConfigurationChanged();
44 void NotifyObserversDeviceListsComplete();
45 void OnDeviceListsComplete();
48 // Tracks whether DeviceDataManager::DeleteInstance() should be called during
50 bool should_delete_instance_
;
52 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerTestAPI
);
58 #endif // UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_