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

Unified Diff: Source/WebCore/testing/InternalSettings.cpp

Issue 13818030: Added primary input devices setting to blink to allow media queries for hover/pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 7 years, 8 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 | « Source/WebCore/testing/InternalSettings.h ('k') | Source/WebCore/testing/InternalSettings.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/testing/InternalSettings.cpp
diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp
index a722b2646d8c41c01ce43bd5eeebfb7ae8ddf107..4a641b43c434689021f50f744ac6eb43647d722e 100644
--- a/Source/WebCore/testing/InternalSettings.cpp
+++ b/Source/WebCore/testing/InternalSettings.cpp
@@ -462,4 +462,33 @@ void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled,
settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled);
}
+void InternalSettings::setPrimaryPointerDevices(const String& pointerDevice, ExceptionCode& ec)
+{
+ InternalSettingsGuardForSettings();
+
+ // Allow setting multiple devices by passing comma seperated list ("mouse,touch")
+ Vector<String> deviceTokens;
+ pointerDevice.split(",", false, deviceTokens);
+
+ int pointerDevices = PointerDeviceUnknown;
+ for(size_t i = 0; i < deviceTokens.size(); ++i) {
+ String token = deviceTokens[i].stripWhiteSpace();
+
+ if (token == "mouse")
+ pointerDevices |= PointerDeviceMouse;
+ else if (token == "touch")
+ pointerDevices |= PointerDeviceTouch;
+ else if (token == "none")
+ pointerDevices |= PointerDeviceNone;
+ else if (token == "unknown")
+ pointerDevices |= PointerDeviceUnknown;
+ else {
+ ec = SYNTAX_ERR;
+ return;
+ }
+ }
+
+ settings()->setPrimaryPointerDevices(pointerDevices);
+}
+
}
« no previous file with comments | « Source/WebCore/testing/InternalSettings.h ('k') | Source/WebCore/testing/InternalSettings.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698