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

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

Issue 485563003: [DevTools] Change navigator.maxTouchPoints when emulating touch. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/core/inspector/InspectorPageAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorPageAgent.cpp
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index eb3a7dc6e39b64af6dde48a2d4e08a11001c43f9..723890d03773db623b606e0adfd271bc5894c302 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -407,6 +407,7 @@ InspectorPageAgent::InspectorPageAgent(Page* page, InjectedScriptManager* inject
, m_originalTouchEnabled(false)
, m_originalDeviceSupportsMouse(false)
, m_originalDeviceSupportsTouch(false)
+ , m_originalMaxTouchPoints(0)
, m_embedderTextAutosizingEnabled(m_page->settings().textAutosizingEnabled())
, m_embedderFontScaleFactor(m_page->settings().deviceScaleAdjustment())
{
@@ -1332,11 +1333,14 @@ void InspectorPageAgent::updateTouchEventEmulationInPage(bool enabled)
m_originalTouchEnabled = RuntimeEnabledFeatures::touchEnabled();
m_originalDeviceSupportsMouse = m_page->settings().deviceSupportsMouse();
m_originalDeviceSupportsTouch = m_page->settings().deviceSupportsTouch();
+ m_originalMaxTouchPoints = m_page->settings().maxTouchPoints();
}
RuntimeEnabledFeatures::setTouchEnabled(enabled ? true : m_originalTouchEnabled);
if (!m_originalDeviceSupportsTouch) {
m_page->settings().setDeviceSupportsMouse(enabled ? false : m_originalDeviceSupportsMouse);
m_page->settings().setDeviceSupportsTouch(enabled ? true : m_originalDeviceSupportsTouch);
+ // Currently emulation does not provide multiple touch points.
+ m_page->settings().setMaxTouchPoints(enabled ? 1 : m_originalMaxTouchPoints);
}
m_touchEmulationEnabled = enabled;
m_client->setTouchEventEmulationEnabled(enabled);
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698