Changeset 109939 in webkit
- Timestamp:
- Mar 6, 2012 11:33:07 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109938 r109939 1 2012-03-05 Joseph Pecoraro <pecoraro@apple.com> 2 3 <http://webkit.org/b/78575> Web Inspector: Disable dock button when not allowed to dock 4 5 There are times when an undocked inspector frontend is not allowed to 6 attach to the main window. We can disable the dock button in those cases. 7 8 Reviewed by Pavel Feldman. 9 10 No new tests. This functionality is port specific right now. 11 12 * page/FrameView.cpp: 13 (WebCore::FrameView::performPostLayoutTasks): 14 When the main frame is resized we let the inspector client know, 15 so that it can react to it as needed. 16 17 * WebCore.exp.in: 18 * inspector/InspectorClient.h: 19 (WebCore::InspectorClient::didResizeMainFrame): 20 * inspector/InspectorController.cpp: 21 * inspector/InspectorController.h: 22 (WebCore::InspectorController::inspectorClient): 23 Call up to the port though to the InspectorClient. 24 25 * inspector/InspectorFrontendClientLocal.cpp: 26 (WebCore::InspectorFrontendClientLocal::frontendLoaded): 27 (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): 28 * inspector/InspectorFrontendClientLocal.h: 29 On ports where the inspector frontend client is local, provide a 30 setDockingUnavailable InspectorFrontendAPI to update the docking state. 31 Automatically update availability when the frontend completes loading. 32 33 * inspector/front-end/InspectorFrontendAPI.js: 34 (InspectorFrontendAPI.setDockingUnavailable): 35 * inspector/front-end/inspector.js: 36 (WebInspector._createGlobalStatusBarItems): 37 (WebInspector.setAttachedWindow): 38 (WebInspector.setDockingUnavailable): 39 (WebInspector.updateDockToggleButton): 40 Update the dock button's enabled/disabled state when its created, 41 when the attached state changes, when get a frontend API notification 42 that we cannot attach. 43 44 * inspector/front-end/InspectorFrontendHostStub.js: 45 Remove unused canAttachWindow method. 46 1 47 2012-03-06 Hans Wennborg <hans@chromium.org> 2 48 -
trunk/Source/WebCore/WebCore.exp.in
r109860 r109939 1744 1744 __ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKN3WTF6StringE 1745 1745 __ZN7WebCore28InspectorFrontendClientLocal21isProfilingJavaScriptEv 1746 __ZN7WebCore28InspectorFrontendClientLocal21setDockingUnavailableEb 1746 1747 __ZN7WebCore28InspectorFrontendClientLocal23stopProfilingJavaScriptEv 1747 1748 __ZN7WebCore28InspectorFrontendClientLocal24showMainResourceForFrameEPNS_5FrameE -
trunk/Source/WebCore/inspector/InspectorClient.h
r109860 r109939 35 35 36 36 class InspectorController; 37 class Node;37 class Frame; 38 38 class Page; 39 39 … … 47 47 virtual void closeInspectorFrontend() = 0; 48 48 virtual void bringFrontendToFront() = 0; 49 virtual void didResizeMainFrame(Frame*) { } 49 50 50 51 virtual void highlight() = 0; -
trunk/Source/WebCore/inspector/InspectorController.cpp
r109922 r109939 362 362 } 363 363 } 364 365 364 #endif 366 365 -
trunk/Source/WebCore/inspector/InspectorController.h
r109860 r109939 109 109 void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize); 110 110 111 InspectorClient* inspectorClient() const { return m_inspectorClient; } 111 112 InspectorPageAgent* pageAgent() const { return m_pageAgent; } 112 113 -
trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
r109860 r109939 139 139 { 140 140 bringToFront(); 141 setDockingUnavailable(!canAttachWindow()); 141 142 m_frontendLoaded = true; 142 143 for (Vector<String>::iterator it = m_evaluateOnLoad.begin(); it != m_evaluateOnLoad.end(); ++it) … … 167 168 unsigned maximumAttachedHeight = inspectedPageHeight * maximumAttachedHeightRatio; 168 169 return minimumAttachedHeight <= maximumAttachedHeight && !isInspectorPage; 170 } 171 172 void InspectorFrontendClientLocal::setDockingUnavailable(bool unavailable) 173 { 174 evaluateOnLoad(String::format("[\"setDockingUnavailable\", %s]", unavailable ? "true" : "false")); 169 175 } 170 176 -
trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h
r109860 r109939 78 78 79 79 bool canAttachWindow(); 80 void setDockingUnavailable(bool); 80 81 81 82 static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight); -
trunk/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
r109860 r109939 96 96 }, 97 97 98 setDockingUnavailable: function(unavailable) 99 { 100 WebInspector.setDockingUnavailable(unavailable); 101 }, 102 98 103 dispatch: function(signature) 99 104 { -
trunk/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js
r108794 r109939 138 138 }, 139 139 140 canAttachWindow: function()141 {142 return false;143 },144 145 140 sendMessageToBackend: function(message) 146 141 { -
trunk/Source/WebCore/inspector/front-end/inspector.js
r109923 r109939 74 74 this._dockToggleButton.addEventListener("click", this._toggleAttach.bind(this), false); 75 75 this._dockToggleButton.toggled = !this.attached; 76 WebInspector.updateDockToggleButton(); 76 77 77 78 this._settingsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Settings"), "settings-status-bar-item"); … … 565 566 { 566 567 this.attached = attached; 568 WebInspector.updateDockToggleButton(); 569 } 570 571 WebInspector.setDockingUnavailable = function(unavailable) 572 { 573 this._isDockingUnavailable = unavailable; 574 WebInspector.updateDockToggleButton(); 575 } 576 577 WebInspector.updateDockToggleButton = function() 578 { 579 if (!this._dockToggleButton) 580 return; 581 this._dockToggleButton.disabled = this.attached ? false : this._isDockingUnavailable; 567 582 } 568 583 -
trunk/Source/WebCore/page/FrameView.cpp
r109860 r109939 50 50 #include "HTMLNames.h" 51 51 #include "HTMLPlugInImageElement.h" 52 #include "InspectorClient.h" 53 #include "InspectorController.h" 52 54 #include "InspectorInstrumentation.h" 53 55 #include "OverflowEvent.h" … … 2332 2334 m_lastLayoutSize = currentSize; 2333 2335 m_lastZoomFactor = currentZoomFactor; 2334 if (resized) 2336 if (resized) { 2335 2337 m_frame->eventHandler()->sendResizeEvent(); 2338 2339 if (InspectorInstrumentation::hasFrontends()) { 2340 if (Page* page = m_frame->page()) { 2341 if (page->mainFrame() == m_frame) { 2342 if (InspectorClient* inspectorClient = page->inspectorController()->inspectorClient()) 2343 inspectorClient->didResizeMainFrame(m_frame.get()); 2344 } 2345 } 2346 } 2347 } 2336 2348 } 2337 2349 } -
trunk/Source/WebKit/mac/ChangeLog
r109866 r109939 1 2012-03-05 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Hide dock button when not allowed to dock 4 https://bugs.webkit.org/show_bug.cgi?id=78575 5 6 Reviewed by Pavel Feldman. 7 8 * WebCoreSupport/WebInspectorClient.h: 9 (WebCore): 10 (WebInspectorClient): 11 * WebCoreSupport/WebInspectorClient.mm: 12 (WebInspectorClient::didResizeMainFrame): 13 1 14 2012-03-05 Gavin Barraclough <barraclough@apple.com> 2 15 -
trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h
r109860 r109939 48 48 namespace WebCore { 49 49 50 class Frame; 50 51 class Page; 51 52 … … 63 64 virtual void closeInspectorFrontend() OVERRIDE; 64 65 virtual void bringFrontendToFront() OVERRIDE; 66 virtual void didResizeMainFrame(WebCore::Frame*) OVERRIDE; 65 67 66 68 virtual void highlight() OVERRIDE; -
trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
r109860 r109939 112 112 } 113 113 114 void WebInspectorClient::didResizeMainFrame(Frame*) 115 { 116 m_frontendClient->setDockingUnavailable(!m_frontendClient->canAttachWindow()); 117 } 118 114 119 void WebInspectorClient::highlight() 115 120 { -
trunk/Source/WebKit2/ChangeLog
r109930 r109939 1 2012-03-05 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Hide dock button when not allowed to dock 4 https://bugs.webkit.org/show_bug.cgi?id=78575 5 6 Reviewed by Pavel Feldman. 7 8 * WebProcess/WebCoreSupport/WebInspectorClient.cpp: 9 (WebKit::WebInspectorClient::didResizeMainFrame): 10 * WebProcess/WebCoreSupport/WebInspectorClient.h: 11 * WebProcess/WebPage/WebInspector.cpp: 12 (WebKit::WebInspector::updateDockingAvailability): 13 * WebProcess/WebPage/WebInspector.h: 14 1 15 2012-03-06 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 16 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp
r109860 r109939 61 61 } 62 62 63 void WebInspectorClient::didResizeMainFrame(Frame*) 64 { 65 m_page->inspector()->updateDockingAvailability(); 66 } 67 63 68 void WebInspectorClient::highlight() 64 69 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h
r109860 r109939 56 56 virtual void closeInspectorFrontend() OVERRIDE; 57 57 virtual void bringFrontendToFront() OVERRIDE; 58 virtual void didResizeMainFrame(WebCore::Frame*) OVERRIDE; 58 59 59 60 virtual void highlight() OVERRIDE; -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
r109860 r109939 222 222 } 223 223 224 void WebInspector::updateDockingAvailability() 225 { 226 if (m_frontendClient) 227 m_frontendClient->setDockingUnavailable(!m_frontendClient->canAttachWindow()); 228 } 229 224 230 } // namespace WebKit 225 231 -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h
r109860 r109939 103 103 void stopJavaScriptProfiling(); 104 104 105 void updateDockingAvailability(); 106 105 107 WebPage* m_page; 106 108 WebPage* m_inspectorPage;
Note: See TracChangeset
for help on using the changeset viewer.