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

Unified Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 243233002: [DevTools] Disable touch emulation on devices with touch input. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/core/inspector/InspectorPageAgent.cpp
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index e01e26537b1821f181ab687d64dc7f8311da7fb1..4bae12ce06458947801c3106fa3e0593bf3ef1a9 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -1164,10 +1164,20 @@ void InspectorPageAgent::updateTouchEventEmulationInPage(bool enabled)
m_client->setTouchEventEmulationEnabled(enabled);
}
-void InspectorPageAgent::setTouchEmulationEnabled(ErrorString*, bool enabled)
+void InspectorPageAgent::hasTouchInputs(ErrorString*, bool* result)
+{
+ *result = m_client->hasTouchInputs();
+}
+
+void InspectorPageAgent::setTouchEmulationEnabled(ErrorString* error, bool enabled)
{
if (m_state->getBoolean(PageAgentState::touchEventEmulationEnabled) == enabled)
return;
+ if (enabled && m_client->hasTouchInputs()) {
+ if (error)
+ *error = "Device already supports touch input";
+ return;
+ }
updateTouchEventEmulationInPage(enabled);
}

Powered by Google App Engine
This is Rietveld 408576698