Title: [92587] trunk/Source
Revision
92587
Author
[email protected]
Date
2011-08-08 01:12:36 -0700 (Mon, 08 Aug 2011)

Log Message

Web Inspector: implement dock/undock in WebKit2 without getting into WebCore.
https://bugs.webkit.org/show_bug.cgi?id=65763

Source/WebCore:

InspectorFrontendClient.h can't have synchronous canAttachWindow() returning value
since in the multiprocess environment, you can't immediately get back to it from the host.

r92384 introduced an unhealthy WebKit -> WebCore -> WebKit canAttach query where embedder
was asking itself a question. This loop was fixed.

Reviewed by Yury Semikhatsky.

* WebCore.exp.in:
* inspector/InspectorController.cpp:
* inspector/InspectorController.h:
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.h:
* inspector/front-end/inspector.js:
(windowLoaded):

Source/WebKit/chromium:

Reviewed by Yury Semikhatsky.

* src/InspectorFrontendClientImpl.cpp:
* src/InspectorFrontendClientImpl.h:
* src/js/DevTools.js:
(devtools.domContentLoaded):

Source/WebKit2:

InspectorFrontendClient.h can't have synchronous canAttachWindow() returning value
since in the multiprocess environment, you can't immediately get back to it from the host.

r92384 introduced an unhealthy WebKit -> WebCore -> WebKit canAttach query where embedder
was asking itself a question. This loop was fixed.

Reviewed by Yury Semikhatsky.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::attach):
(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::didLoadInspectorPage):
(WebKit::WebInspectorProxy::shouldOpenAttached):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/efl/WebInspectorEfl.cpp:
(WebKit::WebInspectorProxy::platformInspectedWindowHeight):
* UIProcess/gtk/WebInspectorGtk.cpp:
(WebKit::WebInspectorProxy::platformInspectedWindowHeight):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformOpen):
(WebKit::WebInspectorProxy::platformInspectedWindowHeight):
* UIProcess/qt/WebInspectorProxyQt.cpp:
(WebKit::WebInspectorProxy::platformOpen):
(WebKit::WebInspectorProxy::platformInspectedWindowHeight):
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformOpen):
(WebKit::WebInspectorProxy::platformInspectedWindowHeight):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::didLoadInspectorPage):
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (92586 => 92587)


--- trunk/Source/WebCore/ChangeLog	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebCore/ChangeLog	2011-08-08 08:12:36 UTC (rev 92587)
@@ -1,3 +1,24 @@
+2011-08-05  Pavel Feldman  <[email protected]>
+
+        Web Inspector: implement dock/undock in WebKit2 without getting into WebCore.
+        https://bugs.webkit.org/show_bug.cgi?id=65763
+
+        InspectorFrontendClient.h can't have synchronous canAttachWindow() returning value
+        since in the multiprocess environment, you can't immediately get back to it from the host.
+
+        r92384 introduced an unhealthy WebKit -> WebCore -> WebKit canAttach query where embedder
+        was asking itself a question. This loop was fixed.
+
+        Reviewed by Yury Semikhatsky.
+
+        * WebCore.exp.in:
+        * inspector/InspectorController.cpp:
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontendClient.h:
+        * inspector/InspectorFrontendClientLocal.h:
+        * inspector/front-end/inspector.js:
+        (windowLoaded):
+
 2011-07-28  Kent Tamura  <[email protected]>
 
         [Chromium] Make form validation bubble fit with Chrome UI style

Modified: trunk/Source/WebCore/WebCore.exp.in (92586 => 92587)


--- trunk/Source/WebCore/WebCore.exp.in	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-08-08 08:12:36 UTC (rev 92587)
@@ -1582,13 +1582,11 @@
 #if ENABLE(INSPECTOR)
 __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
 __ZN7WebCore19InspectorController14enableProfilerEv
-__ZN7WebCore19InspectorController15canAttachWindowEv
 __ZN7WebCore19InspectorController15debuggerEnabledEv
 __ZN7WebCore19InspectorController15disableDebuggerEv
 __ZN7WebCore19InspectorController15disableProfilerEv
 __ZN7WebCore19InspectorController15profilerEnabledEv
 __ZN7WebCore19InspectorController18disconnectFrontendEv
-__ZN7WebCore19InspectorController19requestAttachWindowEv
 __ZN7WebCore19InspectorController20stopTimelineProfilerEv
 __ZN7WebCore19InspectorController21showAndEnableDebuggerEv
 __ZN7WebCore19InspectorController11showConsoleEv

Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (92586 => 92587)


--- trunk/Source/WebCore/inspector/InspectorController.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -509,22 +509,6 @@
     m_resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResourcesContentSize, maximumSingleResourceContentSize);
 }
 
-void InspectorController::requestAttachWindow()
-{
-    if (!m_inspectorFrontendClient)
-        return;
-
-    m_inspectorFrontendClient->requestAttachWindow();
-}
-    
-bool InspectorController::canAttachWindow()
-{
-    if (!m_inspectorFrontendClient)
-        return false;
-    
-    return m_inspectorFrontendClient->canAttachWindow();
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/inspector/InspectorController.h (92586 => 92587)


--- trunk/Source/WebCore/inspector/InspectorController.h	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebCore/inspector/InspectorController.h	2011-08-08 08:12:36 UTC (rev 92587)
@@ -121,9 +121,6 @@
 #endif
 
     void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
-    
-    void requestAttachWindow();
-    bool canAttachWindow();
 
 private:
     friend class PostWorkerNotificationToFrontendTask;

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClient.h (92586 => 92587)


--- trunk/Source/WebCore/inspector/InspectorFrontendClient.h	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClient.h	2011-08-08 08:12:36 UTC (rev 92587)
@@ -58,7 +58,6 @@
     virtual void requestAttachWindow() = 0;
     virtual void requestDetachWindow() = 0;
     virtual void changeAttachedWindowHeight(unsigned) = 0;
-    virtual bool canAttachWindow() = 0;
     virtual void saveAs(const WTF::String& fileName, const WTF::String& content) = 0;
 
     virtual void inspectedURLChanged(const String&) = 0;

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (92586 => 92587)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2011-08-08 08:12:36 UTC (rev 92587)
@@ -64,7 +64,6 @@
     virtual void requestAttachWindow();
     virtual void requestDetachWindow();
     virtual void changeAttachedWindowHeight(unsigned);
-    virtual bool canAttachWindow();
     virtual void saveAs(const String&, const String&) { }
 
     virtual void attachWindow() = 0;
@@ -72,6 +71,8 @@
 
     virtual void sendMessageToBackend(const String& message);
 
+    bool canAttachWindow();
+
     static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight);
 
 protected:

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (92586 => 92587)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2011-08-08 08:12:36 UTC (rev 92587)
@@ -592,6 +592,8 @@
     } else
         WebInspector.loaded();
 
+    WebInspector.setAttachedWindow(WebInspector.queryParamsObject.docked === "true");
+
     window.removeEventListener("DOMContentLoaded", windowLoaded, false);
     delete windowLoaded;
 };

Modified: trunk/Source/WebKit/chromium/ChangeLog (92586 => 92587)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-08-08 08:12:36 UTC (rev 92587)
@@ -1,3 +1,15 @@
+2011-08-05  Pavel Feldman  <[email protected]>
+
+        Web Inspector: implement dock/undock in WebKit2 without getting into WebCore.
+        https://bugs.webkit.org/show_bug.cgi?id=65763
+
+        Reviewed by Yury Semikhatsky.
+
+        * src/InspectorFrontendClientImpl.cpp:
+        * src/InspectorFrontendClientImpl.h:
+        * src/js/DevTools.js:
+        (devtools.domContentLoaded):
+
 2011-08-07  James Kozianski  <[email protected]>
 
         Make the fullscreen JS API enabled at runtime.

Modified: trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp (92586 => 92587)


--- trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -125,12 +125,6 @@
     // Do nothing;
 }
 
-bool InspectorFrontendClientImpl::canAttachWindow()
-{
-    // FIXME: Implement this if it is ever called by Chromium.
-    return false;
-}
-    
 void InspectorFrontendClientImpl::saveAs(const String& fileName, const String& content)
 {
     m_client->saveAs(fileName, content);

Modified: trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h (92586 => 92587)


--- trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h	2011-08-08 08:12:36 UTC (rev 92587)
@@ -66,7 +66,6 @@
     virtual void requestAttachWindow();
     virtual void requestDetachWindow();
     virtual void changeAttachedWindowHeight(unsigned);
-    virtual bool canAttachWindow();
     virtual void saveAs(const WTF::String& fileName, const WTF::String& content);
 
     virtual void inspectedURLChanged(const WTF::String&);

Modified: trunk/Source/WebKit/chromium/src/js/DevTools.js (92586 => 92587)


--- trunk/Source/WebKit/chromium/src/js/DevTools.js	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit/chromium/src/js/DevTools.js	2011-08-08 08:12:36 UTC (rev 92587)
@@ -65,7 +65,6 @@
 
 devtools.domContentLoaded = function()
 {
-    WebInspector.setAttachedWindow(WebInspector.queryParamsObject.docked === "true");
     if (WebInspector.queryParamsObject.toolbarColor && WebInspector.queryParamsObject.textColor)
         WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbarColor, WebInspector.queryParamsObject.textColor);
 }

Modified: trunk/Source/WebKit2/ChangeLog (92586 => 92587)


--- trunk/Source/WebKit2/ChangeLog	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/ChangeLog	2011-08-08 08:12:36 UTC (rev 92587)
@@ -1,3 +1,41 @@
+2011-08-05  Pavel Feldman  <[email protected]>
+
+        Web Inspector: implement dock/undock in WebKit2 without getting into WebCore.
+        https://bugs.webkit.org/show_bug.cgi?id=65763
+
+        InspectorFrontendClient.h can't have synchronous canAttachWindow() returning value
+        since in the multiprocess environment, you can't immediately get back to it from the host.
+
+        r92384 introduced an unhealthy WebKit -> WebCore -> WebKit canAttach query where embedder
+        was asking itself a question. This loop was fixed.
+
+        Reviewed by Yury Semikhatsky.
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::attach):
+        (WebKit::WebInspectorProxy::createInspectorPage):
+        (WebKit::WebInspectorProxy::didLoadInspectorPage):
+        (WebKit::WebInspectorProxy::shouldOpenAttached):
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/WebInspectorProxy.messages.in:
+        * UIProcess/efl/WebInspectorEfl.cpp:
+        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
+        * UIProcess/gtk/WebInspectorGtk.cpp:
+        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::platformOpen):
+        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
+        * UIProcess/qt/WebInspectorProxyQt.cpp:
+        (WebKit::WebInspectorProxy::platformOpen):
+        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
+        * UIProcess/win/WebInspectorProxyWin.cpp:
+        (WebKit::WebInspectorProxy::platformOpen):
+        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::didLoadInspectorPage):
+        * WebProcess/WebPage/WebInspector.h:
+        * WebProcess/WebPage/WebInspector.messages.in:
+
 2011-08-07  Joseph Pecoraro  <[email protected]>
 
         [QT] Possible Leaks WKRetainPtr<> should Adopt allocated Copy

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -120,8 +120,11 @@
 
 void WebInspectorProxy::attach()
 {
+    if (!canAttach())
+        return;
+
     m_isAttached = true;
-    
+
     if (m_isVisible)
         inspectorPageGroup()->preferences()->setInspectorStartsAttached(true);
 
@@ -206,18 +209,19 @@
     inspectorPageID = inspectorPage->pageID();
     inspectorPageParameters = inspectorPage->creationParameters();
 
-    inspectorPage->loadURL(inspectorPageURL());
+    String url = ""
+    if (shouldOpenAttached())
+        url += "?docked=true";
+    inspectorPage->loadURL(url);
 }
 
-void WebInspectorProxy::didLoadInspectorPage(bool canStartAttached)
+void WebInspectorProxy::didLoadInspectorPage()
 {
     m_isVisible = true;
+    m_isAttached = shouldOpenAttached();
 
-    bool willOpenAttached = canStartAttached && inspectorPageGroup()->preferences()->inspectorStartsAttached();
-    platformOpen(willOpenAttached);
-    
-    if (willOpenAttached)
-        m_page->process()->send(Messages::WebInspector::RequestAttachWindow(), m_page->pageID());
+    // platformOpen is responsible for rendering attached mode depending on m_isAttached.
+    platformOpen();
 }
 
 void WebInspectorProxy::didClose()
@@ -243,6 +247,17 @@
     platformInspectedURLChanged(urlString);
 }
 
+bool WebInspectorProxy::canAttach()
+{
+    unsigned inspectedWindowHeight = platformInspectedWindowHeight();
+    return inspectedWindowHeight && minimumAttachedHeight <= (inspectedWindowHeight * 3 / 4);
+}
+
+bool WebInspectorProxy::shouldOpenAttached()
+{
+    return inspectorPageGroup()->preferences()->inspectorStartsAttached() && canAttach();
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2011-08-08 08:12:36 UTC (rev 92587)
@@ -114,10 +114,11 @@
     virtual Type type() const { return APIType; }
 
     WebPageProxy* platformCreateInspectorPage();
-    void platformOpen(bool willOpenAttached);
+    void platformOpen();
     void platformDidClose();
     void platformBringToFront();
     void platformInspectedURLChanged(const String&);
+    unsigned platformInspectedWindowHeight();
     void platformAttach();
     void platformDetach();
     void platformSetAttachedWindowHeight(unsigned);
@@ -127,11 +128,14 @@
 
     // Called by WebInspectorProxy messages
     void createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters&);
-    void didLoadInspectorPage(bool canStartAttached);
+    void didLoadInspectorPage();
     void didClose();
     void bringToFront();
     void inspectedURLChanged(const String&);
 
+    bool canAttach();
+    bool shouldOpenAttached();
+
     static WebPageGroup* inspectorPageGroup();
 
 #if PLATFORM(WIN)
@@ -153,6 +157,7 @@
 
     static const unsigned initialWindowWidth = 750;
     static const unsigned initialWindowHeight = 650;
+    static const unsigned minimumAttachedHeight = 250;
 
     WebPageProxy* m_page;
 

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in	2011-08-08 08:12:36 UTC (rev 92587)
@@ -24,11 +24,11 @@
 
 messages -> WebInspectorProxy {
     CreateInspectorPage() -> (uint64_t inspectorPageID, WebKit::WebPageCreationParameters inspectorPageParameters)
-    DidLoadInspectorPage(bool canStartAttached)
+    DidLoadInspectorPage()
     DidClose()
     BringToFront()
     InspectedURLChanged(WTF::String urlString)
-    
+
     Attach()
     Detach()
     SetAttachedWindowHeight(unsigned height)

Modified: trunk/Source/WebKit2/UIProcess/efl/WebInspectorEfl.cpp (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/efl/WebInspectorEfl.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/efl/WebInspectorEfl.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -65,6 +65,12 @@
     return String();
 }
 
+unsigned WebInspectorProxy::platformInspectedWindowHeight()
+{
+    notImplemented();
+    return 0;
+}
+
 void WebInspectorProxy::platformAttach()
 {
     notImplemented();

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -66,6 +66,12 @@
     return String();
 }
 
+unsigned WebInspectorProxy::platformInspectedWindowHeight()
+{
+    notImplemented();
+    return 0;
+}
+
 void WebInspectorProxy::platformAttach()
 {
     notImplemented();

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2011-08-08 08:12:36 UTC (rev 92587)
@@ -109,7 +109,7 @@
     return toImpl(m_inspectorView.get().pageRef);
 }
 
-void WebInspectorProxy::platformOpen(bool willOpenAttached)
+void WebInspectorProxy::platformOpen()
 {
     ASSERT(!m_inspectorWindow);
 
@@ -135,10 +135,12 @@
     [m_inspectorView.get() setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
     [contentView addSubview:m_inspectorView.get()];
 
-    if (!willOpenAttached)
+    m_inspectorWindow.adoptNS(window);
+
+    if (m_isAttached)
+        platformAttach();
+    else
         [window makeKeyAndOrderFront:nil];
-
-    m_inspectorWindow.adoptNS(window);
 }
 
 void WebInspectorProxy::platformDidClose()
@@ -183,6 +185,13 @@
     [inspectedView setFrame:NSMakeRect(inspectedLeft, inspectorHeight, inspectedWidth, inspectedTop - inspectorHeight)];
 }
 
+unsigned WebInspectorProxy::platformInspectedWindowHeight()
+{
+    WKView *inspectedView = m_page->wkView();
+    NSRect inspectedViewRect = [inspectedView frame];
+    return static_cast<unsigned>(inspectedViewRect.size.height);
+}
+
 void WebInspectorProxy::platformAttach()
 {
     WKView *inspectedView = m_page->wkView();

Modified: trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -39,7 +39,7 @@
     return 0;
 }
 
-void WebInspectorProxy::platformOpen(bool)
+void WebInspectorProxy::platformOpen()
 {
     notImplemented();
 }
@@ -59,6 +59,12 @@
     notImplemented();
 }
 
+unsigned WebInspectorProxy::platformInspectedWindowHeight()
+{
+    notImplemented();
+    return 0;
+}
+
 void WebInspectorProxy::platformAttach()
 {
     notImplemented();

Modified: trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp (92586 => 92587)


--- trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -198,7 +198,7 @@
     return m_inspectorView->page();
 }
 
-void WebInspectorProxy::platformOpen(bool willOpenAttached)
+void WebInspectorProxy::platformOpen()
 {
     registerInspectorViewWindowClass();
 
@@ -208,7 +208,9 @@
 
     m_inspectorView->setParentWindow(m_inspectorWindow);
 
-    if (!willOpenAttached)
+    if (m_isAttached)
+        platformAttach();
+    else
         ::ShowWindow(m_inspectorWindow, SW_SHOW);
 }
 
@@ -245,6 +247,16 @@
     ::SetWindowTextW(m_inspectorWindow, title.charactersWithNullTermination());
 }
 
+unsigned WebInspectorProxy::platformInspectedWindowHeight()
+{
+    HWND inspectedWindow = m_page->nativeWindow();
+
+    RECT inspectedWindowRect;
+    ::GetWindowRect(inspectedWindow, &inspectedWindowRect);
+
+    return static_cast<unsigned>(inspectedWindowRect.bottom - inspectedWindowRect.top);
+}
+
 void WebInspectorProxy::platformAttach()
 {
     HWND webViewWindow = m_page->nativeWindow();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (92586 => 92587)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2011-08-08 08:12:36 UTC (rev 92587)
@@ -78,7 +78,7 @@
 // Called from WebInspectorFrontendClient
 void WebInspector::didLoadInspectorPage()
 {
-    WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage(canAttachWindow()), m_page->pageID());
+    WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage(), m_page->pageID());
 }
 
 void WebInspector::didClose()
@@ -181,16 +181,6 @@
     // FIXME: show the Timeline panel.
 }
 
-void WebInspector::requestAttachWindow()
-{
-    m_inspectorPage->corePage()->inspectorController()->requestAttachWindow();
-}
-
-bool WebInspector::canAttachWindow() const
-{
-    return m_inspectorPage->corePage()->inspectorController()->canAttachWindow();
-}
-
 } // namespace WebKit
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h (92586 => 92587)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h	2011-08-08 08:12:36 UTC (rev 92587)
@@ -59,9 +59,6 @@
     void setJavaScriptProfilingEnabled(bool);
     void startPageProfiling();
     void stopPageProfiling();
-    
-    bool canAttachWindow() const;
-    void requestAttachWindow();
 
 private:
     friend class WebInspectorClient;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in (92586 => 92587)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in	2011-08-08 07:32:09 UTC (rev 92586)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in	2011-08-08 08:12:36 UTC (rev 92587)
@@ -32,8 +32,6 @@
     StopJavaScriptProfiling()
     StartPageProfiling()
     StopPageProfiling()
-
-    RequestAttachWindow()
 }
 
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to