Title: [135250] branches/chromium/1312/Source/WebCore/inspector/InspectorPageAgent.cpp
Revision
135250
Author
apav...@chromium.org
Date
2012-11-19 22:08:16 -0800 (Mon, 19 Nov 2012)

Log Message

Merge 134917 - Web Inspector: [Overrides] Device metrics get reset on navigation, yet remain in the Overrides view
https://bugs.webkit.org/show_bug.cgi?id=102467

Reviewed by Pavel Feldman.

Restore the device metrics overrides from the inspector cookie in InspectorPageAgent::restore().
Drive-by: move the script execution and FPS counter display state restoration from enable() into restore(),
so that they will get restored only upon page navigation, not upon any agent enablement.

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::restore): Restore device metrics overrides, script execution and FPS counter display state.
(WebCore::InspectorPageAgent::enable): Don't restore script execution and FPS counter display state on any enablement.

TBR=apav...@chromium.org
Review URL: https://codereview.chromium.org/11416095

Modified Paths

Diff

Modified: branches/chromium/1312/Source/WebCore/inspector/InspectorPageAgent.cpp (135249 => 135250)


--- branches/chromium/1312/Source/WebCore/inspector/InspectorPageAgent.cpp	2012-11-20 05:49:45 UTC (rev 135249)
+++ branches/chromium/1312/Source/WebCore/inspector/InspectorPageAgent.cpp	2012-11-20 06:08:16 UTC (rev 135250)
@@ -355,6 +355,14 @@
     if (m_state->getBoolean(PageAgentState::pageAgentEnabled)) {
         ErrorString error;
         enable(&error);
+        bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageAgentScriptExecutionDisabled);
+        setScriptExecutionDisabled(0, scriptExecutionDisabled);
+
+        int currentWidth = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenWidthOverride));
+        int currentHeight = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenHeightOverride));
+        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
@@ -364,8 +372,6 @@
 void InspectorPageAgent::enable(ErrorString*)
 {
     m_state->setBoolean(PageAgentState::pageAgentEnabled, true);
-    bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageAgentScriptExecutionDisabled);
-    setScriptExecutionDisabled(0, scriptExecutionDisabled);
     m_instrumentingAgents->setInspectorPageAgent(this);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to