Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: ui/events/test/device_data_manager_test_api.h

Issue 1182303005: Fixed the Touchscreen.TouchEventsEnabled histogram to record the correct values on X11 and Ozone ba… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed asvitkine@'s comments from patch set 11. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/test/device_data_manager_test_api.h
diff --git a/ui/events/test/device_data_manager_test_api.h b/ui/events/test/device_data_manager_test_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..7eb0d21f4e9609dfed13ea9d98cceb9e232f58fe
--- /dev/null
+++ b/ui/events/test/device_data_manager_test_api.h
@@ -0,0 +1,51 @@
+// 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.
+
+#ifndef UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_
+#define UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/events/devices/events_devices_export.h"
+
+namespace ui {
+
+class DeviceDataManager;
+
+namespace test {
+
+// Test API class to access internals of the DeviceDataManager class.
+class DeviceDataManagerTestAPI {
+ public:
+ DeviceDataManagerTestAPI();
+ ~DeviceDataManagerTestAPI();
+
+ // Creates a new ui::DeviceDataManager and sets it as the global instance.
+ // i.e. It is accessible via ui::DeviceDataManager::GetInstance().
+ //
+ // Note: The ui::DeviceDataManager is not available on all platforms, thus
+ // this returns true when it is possible to instantiate a
+ // ui::DeviceDataManager instance and false otherwise.
+ bool CreateDeviceDataManagerInstance();
+
+ // Wrapper functions to DeviceDataManager.
+ void NotifyObserversTouchscreenDeviceConfigurationChanged();
+ void NotifyObserversKeyboardDeviceConfigurationChanged();
+ void NotifyObserversMouseDeviceConfigurationChanged();
+ void NotifyObserversTouchpadDeviceConfigurationChanged();
+ void NotifyObserversDeviceListsComplete();
+ void OnDeviceListsComplete();
+
+ private:
+ // The internal DeviceDataManger instance. Accessible via
+ // DeviceDataManager::GetInstance().
+ scoped_ptr<ui::DeviceDataManager> device_data_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerTestAPI);
+};
+
+} // namespace test
+} // namespace ui
+
+#endif // UI_EVENTS_TEST_DEVICE_DATA_MANAGER_TEST_API_H_

Powered by Google App Engine
This is Rietveld 408576698