Commit 3e6451ee authored by timothy@apple.com's avatar timothy@apple.com

Add support for dock-to-right of the Web Inspector in the Mac port.

Unfortunately this requires Safari changes, so it is disabled in the nightly builds.

https://webkit.org/b/113341
rdar://problem/10368152

Reviewed by Joseph Pecoraro.

.:

* Source/autotools/symbols.filter:

Source/WebCore:

* WebCore.exp.in:
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore):
(WebCore::InspectorFrontendClientLocal::frontendLoaded):
(WebCore::InspectorFrontendClientLocal::requestSetDockSide):
(WebCore::InspectorFrontendClientLocal::canAttachWindow):
(WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
(WebCore::InspectorFrontendClientLocal::setAttachedWindow):
(WebCore::InspectorFrontendClientLocal::constrainedAttachedWindowWidth):
* inspector/InspectorFrontendClientLocal.h:
(InspectorFrontendClientLocal):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::setAttachedWindowWidth):
(WebCore):
* inspector/InspectorFrontendHost.h:
(InspectorFrontendHost):
* inspector/InspectorFrontendHost.idl:
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.setAttachedWindowWidth):
* inspector/front-end/externs.js:
(InspectorFrontendHostAPI.prototype.setAttachedWindowWidth):
* testing/Internals.cpp:

Source/WebKit/chromium:

* src/InspectorFrontendClientImpl.cpp:
(WebKit::InspectorFrontendClientImpl::changeAttachedWindowWidth):
* src/InspectorFrontendClientImpl.h:
(InspectorFrontendClientImpl):

Source/WebKit/efl:

* WebCoreSupport/InspectorClientEfl.cpp:
(WebCore::InspectorFrontendClientEfl::attachWindow):
(WebCore::InspectorFrontendClientEfl::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientEfl.h:
(InspectorFrontendClientEfl):

Source/WebKit/gtk:

* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit::InspectorFrontendClient::attachWindow):
(WebKit::InspectorFrontendClient::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientGtk.h:
(InspectorFrontendClient):

Source/WebKit/mac:

* Resources/Dock.pdf: Updated.
* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient):
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::frontendLoaded):
(WebInspectorFrontendClient::attachWindow):
(WebInspectorFrontendClient::setAttachedWindowWidth):
(-[WebInspectorWindowController attachWindow:]):
(-[WebInspectorWindowController attach]):
(-[WebInspectorWindowController detach]):
* WebInspector/WebInspectorFrontend.mm:
(-[WebInspectorFrontend attach]):

Source/WebKit/qt:

* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorFrontendClientQt::frontendLoaded):
(WebCore::InspectorFrontendClientQt::attachWindow):
(WebCore::InspectorFrontendClientQt::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientQt.h:
(InspectorFrontendClientQt):

Source/WebKit/win:

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::frontendLoaded):
(WebInspectorFrontendClient::attachWindow):
(WebInspectorFrontendClient::setAttachedWindowWidth):
* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient):

Source/WebKit2:

* Resources/Dock.pdf: Removed.
* Resources/DockBottom.pdf: Added.
* Resources/DockRight.pdf: Added.
* Shared/WebPreferencesStore.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
(WebKit::WebInspectorProxy::attachBottom):
(WebKit::WebInspectorProxy::attachRight):
(WebKit::WebInspectorProxy::attach):
(WebKit::WebInspectorProxy::detach):
(WebKit::WebInspectorProxy::setAttachedWindowWidth):
(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::canAttach):
* UIProcess/WebInspectorProxy.h:
(WebInspectorProxy):
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter attachRight:]):
(-[WKWebInspectorProxyObjCAdapter attachBottom:]):
(-[WKWebInspectorWindow _cursorForResizeDirection:]):
(-[WKWebInspectorWindow _customTitleFrame]):
(WebKit::createDockButton):
(WebKit::WebInspectorProxy::createInspectorWindow):
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
(WebKit::WebInspectorProxy::platformInspectedWindowWidth):
(WebKit::WebInspectorProxy::platformAttach):
(WebKit::WebInspectorProxy::platformDetach):
(WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
(WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
(WebKit::WebInspectorFrontendClient::attachWindow):
(WebKit::WebInspectorFrontendClient::setAttachedWindowWidth):
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
(WebInspectorFrontendClient):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::attachBottom):
(WebKit::WebInspector::attachRight):
(WebKit::WebInspector::setAttachedWindowWidth):
(WebKit::WebInspector::attachedBottom):
(WebKit::WebInspector::attachedRight):
(WebKit::WebInspector::detached):
* WebProcess/WebPage/WebInspector.h:
(WebInspector):
* WebProcess/WebPage/WebInspector.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e7a292b3
2013-03-27 Timothy Hatcher <timothy@apple.com>
Add support for dock-to-right of the Web Inspector in the Mac port.
Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
https://webkit.org/b/113341
rdar://problem/10368152
Reviewed by Joseph Pecoraro.
* Source/autotools/symbols.filter:
2013-03-27 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r146864.
......
2013-03-26 Timothy Hatcher <timothy@apple.com>
Add support for dock-to-right of the Web Inspector in the Mac port.
Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
https://webkit.org/b/113341
rdar://problem/10368152
Reviewed by Joseph Pecoraro.
* WebCore.exp.in:
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore):
(WebCore::InspectorFrontendClientLocal::frontendLoaded):
(WebCore::InspectorFrontendClientLocal::requestSetDockSide):
(WebCore::InspectorFrontendClientLocal::canAttachWindow):
(WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
(WebCore::InspectorFrontendClientLocal::setAttachedWindow):
(WebCore::InspectorFrontendClientLocal::constrainedAttachedWindowWidth):
* inspector/InspectorFrontendClientLocal.h:
(InspectorFrontendClientLocal):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::setAttachedWindowWidth):
(WebCore):
* inspector/InspectorFrontendHost.h:
(InspectorFrontendHost):
* inspector/InspectorFrontendHost.idl:
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.setAttachedWindowWidth):
* inspector/front-end/externs.js:
(InspectorFrontendHostAPI.prototype.setAttachedWindowWidth):
* testing/Internals.cpp:
2013-03-27 Eric Carlson <eric.carlson@apple.com>
[Mac] webkitClosedCaptionsVisible doesn't work
......@@ -2523,7 +2523,7 @@ __ZN7WebCore28InspectorFrontendClientLocal12openInNewTabERKN3WTF6StringE
__ZN7WebCore28InspectorFrontendClientLocal13showResourcesEv
__ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv
__ZN7WebCore28InspectorFrontendClientLocal15canAttachWindowEv
__ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb
__ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowENS_23InspectorFrontendClient8DockSideE
__ZN7WebCore28InspectorFrontendClientLocal18isDebuggingEnabledEv
__ZN7WebCore28InspectorFrontendClientLocal18requestSetDockSideENS_23InspectorFrontendClient8DockSideE
__ZN7WebCore28InspectorFrontendClientLocal19setDebuggingEnabledEb
......@@ -2534,10 +2534,12 @@ __ZN7WebCore28InspectorFrontendClientLocal21setDockingUnavailableEb
__ZN7WebCore28InspectorFrontendClientLocal23stopProfilingJavaScriptEv
__ZN7WebCore28InspectorFrontendClientLocal24showMainResourceForFrameEPNS_5FrameE
__ZN7WebCore28InspectorFrontendClientLocal24startProfilingJavaScriptEv
__ZN7WebCore28InspectorFrontendClientLocal25changeAttachedWindowWidthEj
__ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj
__ZN7WebCore28InspectorFrontendClientLocal26isTimelineProfilingEnabledEv
__ZN7WebCore28InspectorFrontendClientLocal27restoreAttachedWindowHeightEv
__ZN7WebCore28InspectorFrontendClientLocal27setTimelineProfilingEnabledEb
__ZN7WebCore28InspectorFrontendClientLocal30constrainedAttachedWindowWidthEjj
__ZN7WebCore28InspectorFrontendClientLocal31constrainedAttachedWindowHeightEjj
__ZN7WebCore28InspectorFrontendClientLocalC2EPNS_19InspectorControllerEPNS_4PageEN3WTF10PassOwnPtrINS0_8SettingsEEE
__ZN7WebCore28InspectorFrontendClientLocalD2Ev
......
......@@ -61,7 +61,10 @@ public:
virtual void requestSetDockSide(DockSide) = 0;
virtual void changeAttachedWindowHeight(unsigned) = 0;
virtual void changeAttachedWindowWidth(unsigned) = 0;
virtual void openInNewTab(const String& url) = 0;
virtual bool canSave() = 0;
virtual void save(const WTF::String& url, const WTF::String& content, bool forceSaveAs) = 0;
virtual void append(const WTF::String& url, const WTF::String& content) = 0;
......
......@@ -63,6 +63,8 @@ static const char* inspectorAttachedHeightSetting = "inspectorAttachedHeight";
static const unsigned defaultAttachedHeight = 300;
static const float minimumAttachedHeight = 250.0f;
static const float maximumAttachedHeightRatio = 0.75f;
static const float minimumAttachedWidth = 750.0f;
static const float minimumAttachedInspectedWidth = 320.0f;
class InspectorBackendDispatchTask {
WTF_MAKE_FAST_ALLOCATED;
......@@ -140,7 +142,8 @@ void InspectorFrontendClientLocal::windowObjectCleared()
void InspectorFrontendClientLocal::frontendLoaded()
{
// Call setDockingUnavailable before bringToFront. If we display the inspector window via bringToFront first it causes the call to canAttachWindow to return the wrong result on Windows.
// Call setDockingUnavailable before bringToFront. If we display the inspector window via bringToFront first it causes
// the call to canAttachWindow to return the wrong result on Windows.
// Calling bringToFront first causes the visibleHeight of the inspected page to always return 0 immediately after.
// Thus if we call canAttachWindow first we can avoid this problem. This change does not cause any regressions on Mac.
setDockingUnavailable(!canAttachWindow());
......@@ -155,21 +158,25 @@ void InspectorFrontendClientLocal::requestSetDockSide(DockSide dockSide)
{
if (dockSide == UNDOCKED) {
detachWindow();
setAttachedWindow(false);
setAttachedWindow(dockSide);
} else if (canAttachWindow()) {
attachWindow();
setAttachedWindow(true);
attachWindow(dockSide);
setAttachedWindow(dockSide);
}
}
bool InspectorFrontendClientLocal::canAttachWindow()
{
// Don't allow the attach if the window would be too small to accommodate the minimum inspector height.
// Also don't allow attaching to another inspector -- two inspectors in one window is too much!
// Don't allow attaching to another inspector -- two inspectors in one window is too much!
bool isInspectorPage = m_inspectorController->hasInspectorFrontendClient();
if (isInspectorPage)
return false;
// Don't allow the attach if the window would be too small to accommodate the minimum inspector size.
unsigned inspectedPageHeight = m_inspectorController->inspectedPage()->mainFrame()->view()->visibleHeight();
unsigned inspectedPageWidth = m_inspectorController->inspectedPage()->mainFrame()->view()->visibleWidth();
unsigned maximumAttachedHeight = inspectedPageHeight * maximumAttachedHeightRatio;
return minimumAttachedHeight <= maximumAttachedHeight && !isInspectorPage;
return minimumAttachedHeight <= maximumAttachedHeight && minimumAttachedWidth <= inspectedPageWidth;
}
void InspectorFrontendClientLocal::setDockingUnavailable(bool unavailable)
......@@ -185,6 +192,13 @@ void InspectorFrontendClientLocal::changeAttachedWindowHeight(unsigned height)
setAttachedWindowHeight(attachedHeight);
}
void InspectorFrontendClientLocal::changeAttachedWindowWidth(unsigned width)
{
unsigned totalWidth = m_frontendPage->mainFrame()->view()->visibleWidth() + m_inspectorController->inspectedPage()->mainFrame()->view()->visibleWidth();
unsigned attachedWidth = constrainedAttachedWindowWidth(width, totalWidth);
setAttachedWindowWidth(attachedWidth);
}
void InspectorFrontendClientLocal::openInNewTab(const String& url)
{
UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
......@@ -212,9 +226,22 @@ void InspectorFrontendClientLocal::moveWindowBy(float x, float y)
m_frontendPage->chrome()->setWindowRect(frameRect);
}
void InspectorFrontendClientLocal::setAttachedWindow(bool attached)
void InspectorFrontendClientLocal::setAttachedWindow(DockSide dockSide)
{
evaluateOnLoad(String::format("[\"setDockSide\", \"%s\"]", attached ? "bottom" : "undocked"));
const char* side = "undocked";
switch (dockSide) {
case UNDOCKED:
side = "undocked";
break;
case DOCKED_TO_RIGHT:
side = "right";
break;
case DOCKED_TO_BOTTOM:
side = "bottom";
break;
}
evaluateOnLoad(String::format("[\"setDockSide\", \"%s\"]", side));
}
void InspectorFrontendClientLocal::restoreAttachedWindowHeight()
......@@ -292,6 +319,12 @@ unsigned InspectorFrontendClientLocal::constrainedAttachedWindowHeight(unsigned
return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));
}
unsigned InspectorFrontendClientLocal::constrainedAttachedWindowWidth(unsigned preferredWidth, unsigned totalWindowWidth)
{
using namespace std;
return roundf(max(minimumAttachedWidth, min<float>(preferredWidth, totalWindowWidth - minimumAttachedInspectedWidth)));
}
void InspectorFrontendClientLocal::sendMessageToBackend(const String& message)
{
m_dispatchTask->dispatch(message);
......
......@@ -65,12 +65,13 @@ public:
virtual void requestSetDockSide(DockSide);
virtual void changeAttachedWindowHeight(unsigned);
virtual void changeAttachedWindowWidth(unsigned);
virtual void openInNewTab(const String& url);
virtual bool canSave() { return false; }
virtual void save(const String&, const String&, bool) { }
virtual void append(const String&, const String&) { }
virtual void attachWindow() = 0;
virtual void attachWindow(DockSide) = 0;
virtual void detachWindow() = 0;
virtual void sendMessageToBackend(const String& message);
......@@ -85,6 +86,7 @@ public:
void setDockingUnavailable(bool);
static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight);
static unsigned constrainedAttachedWindowWidth(unsigned preferredWidth, unsigned totalWindowWidth);
// Direct Frontend API
bool isDebuggingEnabled();
......@@ -103,10 +105,11 @@ public:
void showResources();
void setAttachedWindow(bool);
void setAttachedWindow(DockSide);
protected:
virtual void setAttachedWindowHeight(unsigned) = 0;
virtual void setAttachedWindowWidth(unsigned) = 0;
void restoreAttachedWindowHeight();
private:
......
......@@ -194,6 +194,12 @@ void InspectorFrontendHost::setAttachedWindowHeight(unsigned height)
m_client->changeAttachedWindowHeight(height);
}
void InspectorFrontendHost::setAttachedWindowWidth(unsigned width)
{
if (m_client)
m_client->changeAttachedWindowWidth(width);
}
void InspectorFrontendHost::moveWindowBy(float x, float y) const
{
if (m_client)
......
......@@ -64,7 +64,8 @@ public:
void setZoomFactor(float);
void inspectedURLChanged(const String&);
void setAttachedWindowHeight(unsigned height);
void setAttachedWindowHeight(unsigned);
void setAttachedWindowWidth(unsigned);
void moveWindowBy(float x, float y) const;
void setInjectedScriptForOrigin(const String& origin, const String& script);
......
......@@ -42,6 +42,7 @@
void requestSetDockSide(in DOMString side);
void setAttachedWindowHeight(in unsigned long height);
void setAttachedWindowWidth(in unsigned long width);
void moveWindowBy(in float x, in float y);
void setInjectedScriptForOrigin(in DOMString origin, in DOMString script);
......
......@@ -78,6 +78,10 @@ WebInspector.InspectorFrontendHostStub.prototype = {
{
},
setAttachedWindowWidth: function(width)
{
},
moveWindowBy: function(x, y)
{
},
......
......@@ -168,6 +168,7 @@ InspectorFrontendHostAPI.prototype.bringToFront = function() {}
InspectorFrontendHostAPI.prototype.closeWindow = function() {}
InspectorFrontendHostAPI.prototype.requestSetDockSide = function(dockSide) {}
InspectorFrontendHostAPI.prototype.setAttachedWindowHeight = function(height) {}
InspectorFrontendHostAPI.prototype.setAttachedWindowWidth = function(width) {}
InspectorFrontendHostAPI.prototype.moveWindowBy = function(x, y) {}
InspectorFrontendHostAPI.prototype.setInjectedScriptForOrigin = function(origin, script) {}
InspectorFrontendHostAPI.prototype.loaded = function() {}
......
......@@ -161,7 +161,7 @@ class InspectorFrontendClientDummy : public InspectorFrontendClientLocal {
public:
InspectorFrontendClientDummy(InspectorController*, Page*);
virtual ~InspectorFrontendClientDummy() { }
virtual void attachWindow() OVERRIDE { }
virtual void attachWindow(DockSide) OVERRIDE { }
virtual void detachWindow() OVERRIDE { }
virtual String localizedStringsURL() OVERRIDE { return String(); }
......@@ -173,6 +173,7 @@ public:
protected:
virtual void setAttachedWindowHeight(unsigned) OVERRIDE { }
virtual void setAttachedWindowWidth(unsigned) OVERRIDE { }
};
InspectorFrontendClientDummy::InspectorFrontendClientDummy(InspectorController* controller, Page* page)
......
2013-03-27 Timothy Hatcher <timothy@apple.com>
Add support for dock-to-right of the Web Inspector in the Mac port.
Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
https://webkit.org/b/113341
rdar://problem/10368152
Reviewed by Joseph Pecoraro.
* src/InspectorFrontendClientImpl.cpp:
(WebKit::InspectorFrontendClientImpl::changeAttachedWindowWidth):
* src/InspectorFrontendClientImpl.h:
(InspectorFrontendClientImpl):
2013-03-27 Kent Tamura <tkent@chromium.org>
Rename HTMLFormControlElement::readOnly to isReadOnly
......
......@@ -34,6 +34,7 @@
#include "Document.h"
#include "Frame.h"
#include "InspectorFrontendHost.h"
#include "NotImplemented.h"
#include "Page.h"
#include "ScriptController.h"
#include "V8InspectorFrontendHost.h"
......@@ -114,6 +115,11 @@ void InspectorFrontendClientImpl::changeAttachedWindowHeight(unsigned height)
m_client->changeAttachedWindowHeight(height);
}
void InspectorFrontendClientImpl::changeAttachedWindowWidth(unsigned)
{
notImplemented();
}
void InspectorFrontendClientImpl::openInNewTab(const String& url)
{
m_client->openInNewTab(url);
......
......@@ -63,6 +63,7 @@ public:
virtual void requestSetDockSide(DockSide);
virtual void changeAttachedWindowHeight(unsigned);
virtual void changeAttachedWindowWidth(unsigned);
virtual void openInNewTab(const String& url);
......
2013-03-27 Timothy Hatcher <timothy@apple.com>
Add support for dock-to-right of the Web Inspector in the Mac port.
Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
https://webkit.org/b/113341
rdar://problem/10368152
Reviewed by Joseph Pecoraro.
* WebCoreSupport/InspectorClientEfl.cpp:
(WebCore::InspectorFrontendClientEfl::attachWindow):
(WebCore::InspectorFrontendClientEfl::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientEfl.h:
(InspectorFrontendClientEfl):
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
......
......@@ -182,7 +182,7 @@ void InspectorFrontendClientEfl::inspectedURLChanged(const String&)
notImplemented();
}
void InspectorFrontendClientEfl::attachWindow()
void InspectorFrontendClientEfl::attachWindow(DockSide)
{
notImplemented();
}
......@@ -197,6 +197,11 @@ void InspectorFrontendClientEfl::setAttachedWindowHeight(unsigned)
notImplemented();
}
void InspectorFrontendClientEfl::setAttachedWindowWidth(unsigned)
{
notImplemented();
}
void InspectorFrontendClientEfl::destroyInspectorWindow(bool notifyInspectorController)
{
if (notifyInspectorController)
......
......@@ -81,10 +81,11 @@ public:
virtual void inspectedURLChanged(const String&);
virtual void attachWindow();
virtual void attachWindow(DockSide);
virtual void detachWindow();
virtual void setAttachedWindowHeight(unsigned);
virtual void setAttachedWindowWidth(unsigned);
void disconnectInspectorClient() { m_inspectorClient = 0; }
void destroyInspectorWindow(bool notifyInspectorController);
......
2013-03-27 Timothy Hatcher <timothy@apple.com>
Add support for dock-to-right of the Web Inspector in the Mac port.
Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
https://webkit.org/b/113341
rdar://problem/10368152
Reviewed by Joseph Pecoraro.
* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit::InspectorFrontendClient::attachWindow):
(WebKit::InspectorFrontendClient::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientGtk.h:
(InspectorFrontendClient):
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
......
......@@ -241,7 +241,7 @@ void InspectorFrontendClient::closeWindow()
destroyInspectorWindow(true);
}
void InspectorFrontendClient::attachWindow()
void InspectorFrontendClient::attachWindow(DockSide)
{
if (!m_inspectorWebView)
return;
......@@ -264,6 +264,11 @@ void InspectorFrontendClient::setAttachedWindowHeight(unsigned height)
notImplemented();
}
void InspectorFrontendClient::setAttachedWindowWidth(unsigned width)
{
notImplemented();
}
void InspectorFrontendClient::inspectedURLChanged(const String& newURL)
{
if (!m_inspectorWebView)
......
......@@ -88,10 +88,11 @@ public:
virtual void bringToFront();
virtual void closeWindow();
virtual void attachWindow();
virtual void attachWindow(DockSide);
virtual void detachWindow();
virtual void setAttachedWindowHeight(unsigned);
virtual void setAttachedWindowWidth(unsigned);
virtual void inspectedURLChanged(const WTF::String& newURL);
......
2013-03-26 Timothy Hatcher <timothy@apple.com>
Add support for dock-to-right of the Web Inspector in the Mac port.
Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
https://webkit.org/b/113341
rdar://problem/10368152
Reviewed by Joseph Pecoraro.
* Resources/Dock.pdf: Updated.
* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient):
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::frontendLoaded):
(WebInspectorFrontendClient::attachWindow):
(WebInspectorFrontendClient::setAttachedWindowWidth):
(-[WebInspectorWindowController attachWindow:]):
(-[WebInspectorWindowController attach]):
(-[WebInspectorWindowController detach]):
* WebInspector/WebInspectorFrontend.mm:
(-[WebInspectorFrontend attach]):
2013-03-26 Tim Horton <timothy_horton@apple.com>
Unreviewed attempted cr-mac build fix.
......
......@@ -102,10 +102,12 @@ public:
virtual void closeWindow();
virtual void disconnectFromBackend();
virtual void attachWindow();
virtual void attachWindow(DockSide);
virtual void detachWindow();
virtual void setAttachedWindowHeight(unsigned height);
virtual void setAttachedWindowWidth(unsigned height);
virtual void inspectedURLChanged(const String& newURL);
private:
......
......@@ -42,6 +42,7 @@
#import "WebViewInternal.h"
#import <WebCore/Frame.h>
#import <WebCore/InspectorController.h>
#import <WebCore/InspectorFrontendClient.h>
#import <WebCore/Page.h>
#import <WebCore/ScriptValue.h>
#import <WebCore/SoftLinking.h>
......@@ -210,7 +211,7 @@ void WebInspectorFrontendClient::frontendLoaded()
@selector(webView:didClearInspectorWindowObject:forFrame:), [frame windowObject], frame);
bool attached = [m_windowController.get() attached];
setAttachedWindow(attached);
setAttachedWindow(attached ? DOCKED_TO_BOTTOM : UNDOCKED);
}
static bool useWebKitWebInspector()
......@@ -258,7 +259,7 @@ void WebInspectorFrontendClient::disconnectFromBackend()
[m_windowController.get() destroyInspectorView:false];
}
void WebInspectorFrontendClient::attachWindow()
void WebInspectorFrontendClient::attachWindow(DockSide)
{
if ([m_windowController.get() attached])
return;
......@@ -276,6 +277,11 @@ void WebInspectorFrontendClient::setAttachedWindowHeight(unsigned height)
[m_windowController.get() setAttachedWindowHeight:height];
}
void WebInspectorFrontendClient::setAttachedWindowWidth(unsigned)
{
// Dock to right is not implemented in WebKit 1.
}
void WebInspectorFrontendClient::inspectedURLChanged(const String& newURL)
{
m_inspectedURL = newURL;
......@@ -519,7 +525,7 @@ void WebInspectorFrontendClient::append(const String& url, const String& content
- (IBAction)attachWindow:(id)sender
{
_frontendClient->attachWindow();
_frontendClient->attachWindow(InspectorFrontendClient::DOCKED_TO_BOTTOM);
}
- (IBAction)showWindow:(id)sender
......@@ -569,7 +575,7 @@ void WebInspectorFrontendClient::append(const String& url, const String& content
return;
_inspectorClient->setInspectorStartsAttached(true);
_frontendClient->setAttachedWindow(true);
_frontendClient->setAttachedWindow(InspectorFrontendClient::DOCKED_TO_BOTTOM);
[self close];
[self showWindow:nil];
......@@ -581,7 +587,7 @@ void WebInspectorFrontendClient::append(const String& url, const String& content
return;
_inspectorClient->setInspectorStartsAttached(false);
_frontendClient->setAttachedWindow(false);
_frontendClient->setAttachedWindow(InspectorFrontendClient::UNDOCKED);
[self close];
[self showWindow:nil];
......
......@@ -26,6 +26,9 @@
#import "WebInspectorFrontend.h"
#import "WebInspectorClient.h"
#import <WebCore/InspectorFrontendClient.h>
using namespace WebCore;
@implementation WebInspectorFrontend
......@@ -40,7 +43,7 @@
- (void)attach
{
m_frontendClient->attachWindow();
m_frontendClient->attachWindow(InspectorFrontendClient::DOCKED_TO_BOTTOM);
}
- (void)detach
......
2013-03-27 Timothy Hatcher <timothy@apple.com>
Add support for dock-to-right of the Web Inspector in the Mac port.
Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
https://webkit.org/b/113341
rdar://problem/10368152
Reviewed by Joseph Pecoraro.
* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorFrontendClientQt::frontendLoaded):
(WebCore::InspectorFrontendClientQt::attachWindow):
(WebCore::InspectorFrontendClientQt::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientQt.h:
(InspectorFrontendClientQt):
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
......
......@@ -297,7 +297,7 @@ InspectorFrontendClientQt::~InspectorFrontendClientQt()
void InspectorFrontendClientQt::frontendLoaded()
{
InspectorFrontendClientLocal::frontendLoaded();
setAttachedWindow(true);
setAttachedWindow(DOCKED_TO_BOTTOM);
}