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); |
} |