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

Unified Diff: ui/base/touch/touch_device_util.cc

Issue 2827803002: Make Interaction Media Features MQ dynamic on Linux. (Closed)
Patch Set: Patch for landing, added the mojo bits Created 3 years, 7 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
« no previous file with comments | « ui/base/touch/touch_device_linux.cc ('k') | ui/base/touch/touch_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/touch/touch_device_util.cc
diff --git a/ui/base/touch/touch_device_util.cc b/ui/base/touch/touch_device_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..734c020a6f2734e15e46db5fa0357aac9ce2f68e
--- /dev/null
+++ b/ui/base/touch/touch_device_util.cc
@@ -0,0 +1,30 @@
+// Copyright 2017 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/base/touch/touch_device.h"
+
+namespace ui {
+
+namespace {
+
+int available_pointer_types_for_testing = POINTER_TYPE_NONE;
+int available_hover_types_for_testing = HOVER_TYPE_NONE;
+bool return_available_pointer_and_hover_types_for_testing = false;
+}
+
+void SetAvailablePointerAndHoverTypesForTesting(int available_pointer_types,
+ int available_hover_types) {
+ return_available_pointer_and_hover_types_for_testing = true;
+ available_pointer_types_for_testing = available_pointer_types;
+ available_hover_types_for_testing = available_hover_types;
+}
+
+std::pair<int, int> GetAvailablePointerAndHoverTypes() {
+ if (return_available_pointer_and_hover_types_for_testing)
+ return std::make_pair(available_pointer_types_for_testing,
+ available_hover_types_for_testing);
+ return std::make_pair(GetAvailablePointerTypes(), GetAvailableHoverTypes());
+}
+
+} // namespace ui
« no previous file with comments | « ui/base/touch/touch_device_linux.cc ('k') | ui/base/touch/touch_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698