<http://webkit.org/b/78575> Web Inspector: Hide dock button when not allowed to dock
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Mar 2012 06:03:12 +0000 (06:03 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Mar 2012 06:03:12 +0000 (06:03 +0000)
commit2909a693c0ead747c7220a2cc4e9f95b73c1f404
tree8ab3b2bb4e3e579146d8e43352990b9fa98c45f1
parentb68b270967c5d4e0dc0591c32e5ef1534ec0561f
<webkit.org/b/78575> Web Inspector: Hide dock button when not allowed to dock

Source/WebCore:

There are times when an undocked inspector frontend is not allowed to
attach to the main window. We can remove the dock button in those cases.

Reviewed by Timothy Hatcher.

No new tests. This functionality is port specific right now.

* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):
When the main frame is resized we let the inspector frontend client
update its docked availability.

* WebCore.exp.in:
* inspector/InspectorInstrumentation.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didResizeMainFrameImpl):
(WebCore::InspectorInstrumentation::didResizeMainFrame):
* inspector/InspectorClient.h:
(WebCore::InspectorClient::updateDockingAvailability):
* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::resume):
(WebCore::InspectorController::updateDockingAvailability):
When the main frame is resized call up to the InspectorClient to let
it update docking availability of the inspector frontend.

* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::frontendLoaded):
(WebCore::InspectorFrontendClientLocal::setDockingUnavailable):
On ports where the inspector frontend client is local, provide a
setDockingUnavailable InspectorFrontendAPI to update the docking state.
Automatically update availablity when the frontend completes loading.

* inspector/front-end/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setDockingUnavailable):
* inspector/front-end/inspector.js:
(WebInspector._createGlobalStatusBarItems):
(WebInspector.setAttachedWindow):
(WebInspector.setDockingUnavailable):
(WebInspector.updateDockToggleButtonVisibility):
Update the dock button's visibility when its created, when the attached
state changes, when get a frontend API notification that we cannot attach.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorClient):
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::updateDockingAvailability):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::updateDockingAvailability):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::updateDockingAvailability):
* WebProcess/WebPage/WebInspector.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/InspectorClient.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorFrontendClient.h
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorFrontendClientLocal.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
Source/WebCore/inspector/front-end/inspector.js
Source/WebCore/page/FrameView.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
Source/WebKit2/WebProcess/WebPage/WebInspector.h