Remember the docked state of the Web Inspector, so it can be reopened docked if it...
[WebKit-https.git] / WebCore / page / InspectorController.cpp
index af17de7..021bb55 100644 (file)
@@ -1210,7 +1210,7 @@ bool InspectorController::windowVisible()
     return m_windowVisible;
 }
 
-void InspectorController::setWindowVisible(bool visible)
+void InspectorController::setWindowVisible(bool visible, bool attached)
 {
     if (visible == m_windowVisible)
         return;
@@ -1221,6 +1221,7 @@ void InspectorController::setWindowVisible(bool visible)
         return;
 
     if (m_windowVisible) {
+        setAttachedWindow(attached);
         populateScriptObjects();
         if (m_nodeToFocus)
             focusNode();
@@ -1326,6 +1327,17 @@ void InspectorController::detachWindow()
     m_client->detachWindow();
 }
 
+void InspectorController::setAttachedWindow(bool attached)
+{
+    if (!enabled() || !m_scriptContext || !m_scriptObject)
+        return;
+
+    JSValueRef attachedValue = JSValueMakeBoolean(m_scriptContext, attached);
+
+    JSValueRef exception = 0;
+    callFunction(m_scriptContext, m_scriptObject, "setAttachedWindow", 1, &attachedValue, exception);
+}
+
 void InspectorController::setAttachedWindowHeight(unsigned height)
 {
     if (!enabled())