Index: ui/events/test/device_data_manager_test_api_impl.cc |
diff --git a/ui/events/test/device_data_manager_test_api_impl.cc b/ui/events/test/device_data_manager_test_api_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8af7928b366e158cfaa5c976013fbd06a9bb2744 |
--- /dev/null |
+++ b/ui/events/test/device_data_manager_test_api_impl.cc |
@@ -0,0 +1,60 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ui/events/test/device_data_manager_test_api.h" |
+ |
+#include "ui/events/devices/device_data_manager.h" |
+ |
+namespace ui { |
+namespace test { |
+ |
+DeviceDataManagerTestAPI::DeviceDataManagerTestAPI(bool delete_instance) |
+ : delete_instance_(delete_instance) { |
+} |
+ |
+DeviceDataManagerTestAPI::~DeviceDataManagerTestAPI() { |
+ if (delete_instance_) |
+ DeviceDataManager::DeleteInstance(); |
+} |
+ |
+bool DeviceDataManagerTestAPI::CreateDeviceDataManagerInstance() { |
+ DeviceDataManager::DeleteInstance(); |
+ DeviceDataManager::set_instance(new DeviceDataManager()); |
+ return true; |
+} |
+ |
+void DeviceDataManagerTestAPI:: |
+ NotifyObserversTouchscreenDeviceConfigurationChanged() { |
+ DeviceDataManager::GetInstance() |
+ ->NotifyObserversTouchscreenDeviceConfigurationChanged(); |
+} |
+ |
+void DeviceDataManagerTestAPI:: |
+ NotifyObserversKeyboardDeviceConfigurationChanged() { |
+ DeviceDataManager::GetInstance() |
+ ->NotifyObserversKeyboardDeviceConfigurationChanged(); |
+} |
+ |
+void DeviceDataManagerTestAPI:: |
+ NotifyObserversMouseDeviceConfigurationChanged() { |
+ DeviceDataManager::GetInstance() |
+ ->NotifyObserversMouseDeviceConfigurationChanged(); |
+} |
+ |
+void DeviceDataManagerTestAPI:: |
+ NotifyObserversTouchpadDeviceConfigurationChanged() { |
+ DeviceDataManager::GetInstance() |
+ ->NotifyObserversTouchpadDeviceConfigurationChanged(); |
+} |
+ |
+void DeviceDataManagerTestAPI::NotifyObserversDeviceListsComplete() { |
+ DeviceDataManager::GetInstance()->NotifyObserversDeviceListsComplete(); |
+} |
+ |
+void DeviceDataManagerTestAPI::OnDeviceListsComplete() { |
+ DeviceDataManager::GetInstance()->OnDeviceListsComplete(); |
+} |
+ |
+} // namespace test |
+} // namespace ui |