| Index: Source/core/inspector/InspectorPageAgent.cpp
|
| diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
|
| index 7c48b470ffd228877772f6f71f3412b982352078..e9c8d6d55280643efb1942c128558bba184480cc 100644
|
| --- a/Source/core/inspector/InspectorPageAgent.cpp
|
| +++ b/Source/core/inspector/InspectorPageAgent.cpp
|
| @@ -95,7 +95,9 @@ static const char pageAgentShowFPSCounter[] = "pageAgentShowFPSCounter";
|
| static const char pageAgentContinuousPaintingEnabled[] = "pageAgentContinuousPaintingEnabled";
|
| static const char pageAgentShowPaintRects[] = "pageAgentShowPaintRects";
|
| static const char pageAgentShowDebugBorders[] = "pageAgentShowDebugBorders";
|
| +#if ENABLE(TOUCH_EVENTS)
|
| static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled";
|
| +#endif
|
| static const char pageAgentEmulatedMedia[] = "pageAgentEmulatedMedia";
|
| }
|
|
|
| @@ -345,7 +347,9 @@ void InspectorPageAgent::clearFrontend()
|
| {
|
| ErrorString error;
|
| disable(&error);
|
| +#if ENABLE(TOUCH_EVENTS)
|
| updateTouchEventEmulationInPage(false);
|
| +#endif
|
| m_frontend = 0;
|
| }
|
|
|
| @@ -372,7 +376,9 @@ void InspectorPageAgent::restore()
|
| double currentFontScaleFactor = m_state->getDouble(PageAgentState::pageAgentFontScaleFactorOverride);
|
| bool currentFitWindow = m_state->getBoolean(PageAgentState::pageAgentFitWindow);
|
| updateViewMetrics(currentWidth, currentHeight, currentFontScaleFactor, currentFitWindow);
|
| +#if ENABLE(TOUCH_EVENTS)
|
| updateTouchEventEmulationInPage(m_state->getBoolean(PageAgentState::touchEventEmulationEnabled));
|
| +#endif
|
| }
|
| }
|
|
|
| @@ -1084,12 +1090,14 @@ void InspectorPageAgent::updateViewMetrics(int width, int height, double fontSca
|
| InspectorInstrumentation::mediaQueryResultChanged(document);
|
| }
|
|
|
| +#if ENABLE(TOUCH_EVENTS)
|
| void InspectorPageAgent::updateTouchEventEmulationInPage(bool enabled)
|
| {
|
| m_state->setBoolean(PageAgentState::touchEventEmulationEnabled, enabled);
|
| if (mainFrame() && mainFrame()->settings())
|
| mainFrame()->settings()->setTouchEventEmulationEnabled(enabled);
|
| }
|
| +#endif
|
|
|
| void InspectorPageAgent::setGeolocationOverride(ErrorString* error, const double* latitude, const double* longitude, const double* accuracy)
|
| {
|
| @@ -1163,10 +1171,15 @@ DeviceOrientationData* InspectorPageAgent::overrideDeviceOrientation(DeviceOrien
|
|
|
| void InspectorPageAgent::setTouchEmulationEnabled(ErrorString* error, bool enabled)
|
| {
|
| +#if ENABLE(TOUCH_EVENTS)
|
| if (m_state->getBoolean(PageAgentState::touchEventEmulationEnabled) == enabled)
|
| return;
|
| UNUSED_PARAM(error);
|
| updateTouchEventEmulationInPage(enabled);
|
| +#else
|
| + *error = "Touch events emulation not supported";
|
| + UNUSED_PARAM(enabled);
|
| +#endif
|
| }
|
|
|
| void InspectorPageAgent::setEmulatedMedia(ErrorString*, const String& media)
|
|
|