Title: [134346] trunk/Source
Revision
134346
Author
[email protected]
Date
2012-11-12 20:05:09 -0800 (Mon, 12 Nov 2012)

Log Message

Add a dock button to the top right corner of the Web Inspector window (similar to the full screen button).

Source/WebCore: Expose InspectorFrontendClientLocal::setAttachedWindow as public.

This allows external actions to update the docked state in the frontend.

https://bugs.webkit.org/show_bug.cgi?id=102023

Reviewed by Anders Carlsson.

* inspector/InspectorFrontendClientLocal.h:
Moved InspectorFrontendClientLocal::setAttachedWindow to public section.

Source/WebKit2: Add a dock button to the top right corner of the Web Inspector window (similar to the full screen button).

https://bugs.webkit.org/show_bug.cgi?id=102023

Reviewed by Anders Carlsson.

* Resources/Dock.pdf: Added.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::attach): Set the SetAttachedWindow message.
(WebKit::WebInspectorProxy::detach): Ditto.
(WebKit::WebInspectorProxy::attachAvailabilityChanged): Added. Call platformAttachAvailabilityChanged.
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in: Added AttachAvailabilityChanged message.
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter attach:]): Added. Call WebInspectorProxy::attach.
(-[WKWebInspectorWindow _cursorForResizeDirection:]): Added.
(WebKit::WebInspectorProxy::createInspectorWindow): Create the dock button and add it.
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Added. Update hidden state of the dock button.
* WebKit2.xcodeproj/project.pbxproj: Added Dock.pdf.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::setAttachedWindow): Added. Call through to the frontend client.
(WebKit::WebInspector::updateDockingAvailability): Send AttachAvailabilityChanged message.
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in: Added SetAttachedWindow message.

* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Added stub.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Ditto.
* UIProcess/qt/WebInspectorProxyQt.cpp:
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Ditto.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Ditto.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134345 => 134346)


--- trunk/Source/WebCore/ChangeLog	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebCore/ChangeLog	2012-11-13 04:05:09 UTC (rev 134346)
@@ -1,3 +1,16 @@
+2012-11-12  Timothy Hatcher  <[email protected]>
+
+        Expose InspectorFrontendClientLocal::setAttachedWindow as public.
+
+        This allows external actions to update the docked state in the frontend.
+
+        https://bugs.webkit.org/show_bug.cgi?id=102023
+
+        Reviewed by Anders Carlsson.
+
+        * inspector/InspectorFrontendClientLocal.h:
+        Moved InspectorFrontendClientLocal::setAttachedWindow to public section.
+
 2012-11-12  Erik Arvidsson  <[email protected]>
 
         Replace DOMException TYPE_MISMATCH_ERR with TypeError

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (134345 => 134346)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2012-11-13 04:05:09 UTC (rev 134346)
@@ -98,9 +98,10 @@
     
     void showResources();
 
+    void setAttachedWindow(bool);
+
 protected:
     virtual void setAttachedWindowHeight(unsigned) = 0;
-    void setAttachedWindow(bool);
     void restoreAttachedWindowHeight();
 
 private:

Modified: trunk/Source/WebKit2/ChangeLog (134345 => 134346)


--- trunk/Source/WebKit2/ChangeLog	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-13 04:05:09 UTC (rev 134346)
@@ -1,3 +1,39 @@
+2012-11-12  Timothy Hatcher  <[email protected]>
+
+        Add a dock button to the top right corner of the Web Inspector window (similar to the full screen button).
+
+        https://bugs.webkit.org/show_bug.cgi?id=102023
+
+        Reviewed by Anders Carlsson.
+
+        * Resources/Dock.pdf: Added.
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::attach): Set the SetAttachedWindow message.
+        (WebKit::WebInspectorProxy::detach): Ditto.
+        (WebKit::WebInspectorProxy::attachAvailabilityChanged): Added. Call platformAttachAvailabilityChanged.
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/WebInspectorProxy.messages.in: Added AttachAvailabilityChanged message.
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (-[WKWebInspectorProxyObjCAdapter attach:]): Added. Call WebInspectorProxy::attach.
+        (-[WKWebInspectorWindow _cursorForResizeDirection:]): Added.
+        (WebKit::WebInspectorProxy::createInspectorWindow): Create the dock button and add it.
+        (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Added. Update hidden state of the dock button.
+        * WebKit2.xcodeproj/project.pbxproj: Added Dock.pdf.
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::setAttachedWindow): Added. Call through to the frontend client.
+        (WebKit::WebInspector::updateDockingAvailability): Send AttachAvailabilityChanged message.
+        * WebProcess/WebPage/WebInspector.h:
+        * WebProcess/WebPage/WebInspector.messages.in: Added SetAttachedWindow message.
+
+        * UIProcess/efl/WebInspectorProxyEfl.cpp:
+        (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Added stub.
+        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+        (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Ditto.
+        * UIProcess/qt/WebInspectorProxyQt.cpp:
+        (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Ditto.
+        * UIProcess/win/WebInspectorProxyWin.cpp:
+        (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Ditto.
+
 2012-11-12  Anders Carlsson  <[email protected]>
 
         Include child layers in the remote layer tree transaction

Added: trunk/Source/WebKit2/Resources/Dock.pdf (0 => 134346)


--- trunk/Source/WebKit2/Resources/Dock.pdf	                        (rev 0)
+++ trunk/Source/WebKit2/Resources/Dock.pdf	2012-11-13 04:05:09 UTC (rev 134346)
@@ -0,0 +1,88 @@
+%PDF-1.3
+%\xC4\xE5\xF2\xE5\xEB\xA7\xF3\xA0\xD0\xC4\xC6
+4 0 obj
+<< /Length 5 0 R /Filter /FlateDecode >>
+stream
+xU\x901n\xC40{\xBD\x82u
+\x85\x94II\xAC\xEF\xF7A\\x8A\x83\xFFdI\xE4\xE4v\xC1\xB5w\xB8+=\xE9NO\xE2\xDA\xE9\x8B\xDEo\xA7\xD0:\x89\xF39\xB5\xCAlӜD\xE9\x9BD\xAA\xBBb\xC4\xFB 9\xAAp\xF3T\xF1-\xA4\xB8\x95\x98_\xC6ֽ\x8C"i\xFA\xE0β	\x84m\x80\xE9
+-\x8C\x94˞\xA5O\xB6\xC3\xC0\xEC\xB5\xEB\xEFW\xB3\x80\xD3\xA5\xB6\xF3\xA2Ohw;|\xD2\xC4\xD1ZU\xB5n\xD1hTS\xE7f92{k-j%\xC1c\xCC\xF2H\xA1z\xD8쁚\xF5\x8E\x80ke\xF8q&f\xC5\xFF\xB8+\xA9f\xB0CH\xD8\xD4؇a.\xD1"vɿq@\xB2\x87\xF5\xBCo\xE0HS\xB4{m
+\xE0\xFF\xCA\xC7\xDDӵZ\xCB
+endstream
+endobj
+5 0 obj
+227
+endobj
+2 0 obj
+<< /Type /Page /Parent 3 0 R /Resources 6 0 R /Contents 4 0 R /MediaBox [0 0 14 14]
+>>
+endobj
+6 0 obj
+<< /ProcSet [ /PDF ] /ColorSpace << /Cs1 7 0 R >> >>
+endobj
+8 0 obj
+<< /Length 9 0 R /N 3 /Alternate /DeviceRGB /Filter /FlateDecode >>
+stream
+x\xAD\x96gTT\xD7\xC7Ͻ\xD3m`\xE80\xF4\xDE;H\xEFMz\x95a\xE8e\x84\xA1#*"\xC1DP	U\xC1\xA8\xD4XQD	
+X\xD0\x94,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r\xA4\x9E\xEE@d6"M>\xAE\xAF\xBF\x97\xD7\xC0W\xF6\xFA\xFAک\xF5\xF5\xAFu\xA0Л\xB4\xA9\xB9\xD9X>\xCE\xF0pip\xB8(\x87\xDB\xFF\xD3\xFE\xBB\xB8\xA2
+endstream
+endobj
+9 0 obj
+2561
+endobj
+7 0 obj
+[ /ICCBased 8 0 R ]
+endobj
+3 0 obj
+<< /Type /Pages /MediaBox [0 0 14 14] /Count 1 /Kids [ 2 0 R ] >>
+endobj
+10 0 obj
+<< /Type /Catalog /Pages 3 0 R >>
+endobj
+11 0 obj
+(Mac OS X 10.8.2 Quartz PDFContext)
+endobj
+12 0 obj
+(D:20121113023024Z00'00')
+endobj
+1 0 obj
+<< /Producer 11 0 R /CreationDate 12 0 R /ModDate 12 0 R >>
+endobj
+xref
+0 13
+0000000000 65535 f 
+0000003454 00000 n 
+0000000342 00000 n 
+0000003229 00000 n 
+0000000022 00000 n 
+0000000323 00000 n 
+0000000444 00000 n 
+0000003194 00000 n 
+0000000512 00000 n 
+0000003174 00000 n 
+0000003310 00000 n 
+0000003360 00000 n 
+0000003412 00000 n 
+trailer
+<< /Size 13 /Root 10 0 R /Info 1 0 R /ID [ <72f7d5baa035dddcbdcfff169ed9325c>
+<72f7d5baa035dddcbdcfff169ed9325c> ] >>
+startxref
+3529
+%%EOF

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2012-11-13 04:05:09 UTC (rev 134346)
@@ -179,6 +179,8 @@
     if (m_isVisible)
         inspectorPageGroup()->preferences()->setInspectorStartsAttached(true);
 
+    m_page->process()->send(Messages::WebInspector::SetAttachedWindow(true), m_page->pageID());
+
     platformAttach();
 }
 
@@ -189,6 +191,8 @@
     if (m_isVisible)
         inspectorPageGroup()->preferences()->setInspectorStartsAttached(false);
 
+    m_page->process()->send(Messages::WebInspector::SetAttachedWindow(false), m_page->pageID());
+
     platformDetach();
 }
 
@@ -365,6 +369,11 @@
     platformBringToFront();
 }
 
+void WebInspectorProxy::attachAvailabilityChanged(bool available)
+{
+    platformAttachAvailabilityChanged(available);
+}
+
 void WebInspectorProxy::inspectedURLChanged(const String& urlString)
 {
     platformInspectedURLChanged(urlString);

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2012-11-13 04:05:09 UTC (rev 134346)
@@ -39,6 +39,7 @@
 #if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
 
+OBJC_CLASS NSButton;
 OBJC_CLASS NSWindow;
 OBJC_CLASS WKWebInspectorProxyObjCAdapter;
 OBJC_CLASS WKWebInspectorWKView;
@@ -153,6 +154,7 @@
     void platformDidClose();
     void platformBringToFront();
     bool platformIsFront();
+    void platformAttachAvailabilityChanged(bool);
     void platformInspectedURLChanged(const String&);
     unsigned platformInspectedWindowHeight();
     void platformAttach();
@@ -164,6 +166,7 @@
     void didLoadInspectorPage();
     void didClose();
     void bringToFront();
+    void attachAvailabilityChanged(bool);
     void inspectedURLChanged(const String&);
 
 #if ENABLE(INSPECTOR_SERVER)
@@ -213,6 +216,7 @@
 #if PLATFORM(MAC)
     RetainPtr<WKWebInspectorWKView> m_inspectorView;
     RetainPtr<NSWindow> m_inspectorWindow;
+    RetainPtr<NSButton> m_dockButton;
     RetainPtr<WKWebInspectorProxyObjCAdapter> m_inspectorProxyObjCAdapter;
     String m_urlString;
 #elif PLATFORM(WIN)

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in	2012-11-13 04:05:09 UTC (rev 134346)
@@ -31,6 +31,7 @@
 
     Attach()
     Detach()
+    AttachAvailabilityChanged(bool available)
     SetAttachedWindowHeight(unsigned height)
 
 #if ENABLE(INSPECTOR_SERVER)

Modified: trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2012-11-13 04:05:09 UTC (rev 134346)
@@ -188,6 +188,11 @@
     notImplemented();
 }
 
+void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
+{
+    notImplemented();
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2012-11-13 04:05:09 UTC (rev 134346)
@@ -34,6 +34,7 @@
 #include "WebProcessProxy.h"
 #include <WebCore/FileSystem.h>
 #include <WebCore/GtkUtilities.h>
+#include <WebCore/NotImplemented.h>
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
 #include <wtf/gobject/GOwnPtr.h>
@@ -221,6 +222,11 @@
     webkitWebViewBaseSetInspectorViewHeight(WEBKIT_WEB_VIEW_BASE(m_page->viewWidget()), height);
 }
 
+void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
+{
+    notImplemented();
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2012-11-13 04:05:09 UTC (rev 134346)
@@ -50,6 +50,9 @@
 // The height needed to match a typical NSToolbar.
 static const CGFloat windowContentBorderThickness = 55;
 
+// The margin from the top and right of the dock button (same as the full screen button).
+static const CGFloat dockButtonMargin = 3;
+
 // WKWebInspectorProxyObjCAdapter is a helper ObjC object used as a delegate or notification observer
 // for the sole purpose of getting back into the C++ code from an ObjC caller.
 
@@ -79,6 +82,11 @@
     return self;
 }
 
+- (IBAction)attach:(id)sender
+{
+    static_cast<WebInspectorProxy*>(_inspectorProxy)->attach();
+}
+
 - (void)close
 {
     _inspectorProxy = 0;
@@ -117,6 +125,29 @@
 
 @end
 
+@interface NSWindow (AppKitDetails)
+- (NSCursor *)_cursorForResizeDirection:(NSInteger)direction;
+@end
+
+@interface WKWebInspectorWindow : NSWindow {
+@public
+    RetainPtr<NSButton> _dockButton;
+}
+@end
+
+@implementation WKWebInspectorWindow
+
+- (NSCursor *)_cursorForResizeDirection:(NSInteger)direction
+{
+    // Don't show a resize cursor for the northeast (top right) direction if the dock button is visible.
+    // This matches what happens when the full screen button is visible.
+    if (direction == 1 && ![_dockButton isHidden])
+        return nil;
+    return [super _cursorForResizeDirection:direction];
+}
+
+@end
+
 namespace WebKit {
 
 static bool inspectorReallyUsesWebKitUserInterface(WebPreferences* preferences)
@@ -140,7 +171,7 @@
     ASSERT(!m_inspectorWindow);
 
     NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask | NSTexturedBackgroundWindowMask);
-    NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
+    WKWebInspectorWindow *window = [[WKWebInspectorWindow alloc] initWithContentRect:NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
     [window setDelegate:m_inspectorProxyObjCAdapter.get()];
     [window setMinSize:NSMakeSize(minimumWindowWidth, minimumWindowHeight)];
     [window setReleasedWhenClosed:NO];
@@ -149,6 +180,45 @@
     WKNSWindowMakeBottomCornersSquare(window);
 
     NSView *contentView = [window contentView];
+
+    // Create a full screen button so we can turn it into a dock button.
+    m_dockButton = [NSWindow standardWindowButton:NSWindowFullScreenButton forStyleMask:styleMask];
+    m_dockButton.get().target = m_inspectorProxyObjCAdapter.get();
+    m_dockButton.get().action = ""
+
+    // Store the dock button on the window too so it can check its visibility.
+    window->_dockButton = m_dockButton;
+
+    // Get the dock image and make it a template so the button cell effects will apply.
+    NSImage *dockImage = [[NSBundle bundleForClass:[WKWebInspectorWKView class]] imageForResource:@"Dock"];
+    [dockImage setTemplate:YES];
+
+    // Set the dock image on the button cell.
+    NSCell *dockButtonCell = m_dockButton.get().cell;
+    dockButtonCell.image = dockImage;
+
+    // Get the frame view, the superview of the content view, and its frame.
+    // This will be the superview of the dock button too.
+    NSView *frameView = contentView.superview;
+    NSRect frameViewBounds = frameView.bounds;
+    NSSize dockButtonSize = m_dockButton.get().frame.size;
+
+    ASSERT(!frameView.flipped);
+
+    // Position the dock button in the corner to match where the full screen button is normally.
+    NSPoint dockButtonOrigin;
+    dockButtonOrigin.x = NSMaxX(frameViewBounds) - dockButtonSize.width - dockButtonMargin;
+    dockButtonOrigin.y = NSMaxY(frameViewBounds) - dockButtonSize.height - dockButtonMargin;
+    m_dockButton.get().frameOrigin = dockButtonOrigin;
+
+    // Set the autoresizing mask to keep the dock button pinned to the top right corner.
+    m_dockButton.get().autoresizingMask = NSViewMinXMargin | NSViewMinYMargin;
+
+    [frameView addSubview:m_dockButton.get()];
+
+    // Hide the dock button if we can't attach.
+    m_dockButton.get().hidden = !canAttach();
+
     [m_inspectorView.get() setFrame:[contentView bounds]];
     [m_inspectorView.get() setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
     [contentView addSubview:m_inspectorView.get()];
@@ -231,6 +301,11 @@
     return m_isVisible && [m_inspectorView.get().window isMainWindow];
 }
 
+void WebInspectorProxy::platformAttachAvailabilityChanged(bool available)
+{
+    m_dockButton.get().hidden = !available;
+}
+
 void WebInspectorProxy::platformInspectedURLChanged(const String& urlString)
 {
     m_urlString = urlString;

Modified: trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp	2012-11-13 04:05:09 UTC (rev 134346)
@@ -81,6 +81,11 @@
     notImplemented();
 }
 
+void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
+{
+    notImplemented();
+}
+
 void WebInspectorProxy::platformSetAttachedWindowHeight(unsigned)
 {
     notImplemented();

Modified: trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp (134345 => 134346)


--- trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp	2012-11-13 04:05:09 UTC (rev 134346)
@@ -247,6 +247,11 @@
     return false;
 }
 
+void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
+{
+    notImplemented();
+}
+
 void WebInspectorProxy::platformInspectedURLChanged(const String& urlString)
 {
     // FIXME: this should be made localizable once WebKit2 supports it. <rdar://problem/8728860>

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (134345 => 134346)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2012-11-13 04:05:09 UTC (rev 134346)
@@ -274,6 +274,7 @@
 		1CA8B945127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */; };
 		1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */; };
 		1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */; };
+		1CBC945E16515ED200D68AAE /* Dock.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 1CBC945D16515ED200D68AAE /* Dock.pdf */; };
 		293EBEAB1627D9C9005F89F1 /* WKDOMText.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EBEA91627D9C9005F89F1 /* WKDOMText.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		293EBEAC1627D9C9005F89F1 /* WKDOMText.mm in Sources */ = {isa = PBXBuildFile; fileRef = 293EBEAA1627D9C9005F89F1 /* WKDOMText.mm */; };
 		29501724162A4504004A9D71 /* WKWebProcessPlugInBrowserContextControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 29501723162A4504004A9D71 /* WKWebProcessPlugInBrowserContextControllerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1470,6 +1471,7 @@
 		1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorProxyMac.mm; sourceTree = "<group>"; };
 		1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorProxyMessageReceiver.cpp; sourceTree = "<group>"; };
 		1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorProxyMessages.h; sourceTree = "<group>"; };
+		1CBC945D16515ED200D68AAE /* Dock.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = Dock.pdf; path = Resources/Dock.pdf; sourceTree = "<group>"; };
 		293EBEA91627D9C9005F89F1 /* WKDOMText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDOMText.h; sourceTree = "<group>"; };
 		293EBEAA1627D9C9005F89F1 /* WKDOMText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKDOMText.mm; sourceTree = "<group>"; };
 		29501723162A4504004A9D71 /* WKWebProcessPlugInBrowserContextControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInBrowserContextControllerPrivate.h; sourceTree = "<group>"; };
@@ -2453,6 +2455,7 @@
 		089C1665FE841158C02AAC07 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				1CBC945D16515ED200D68AAE /* Dock.pdf */,
 				510CC84A1613C8AB00D03ED3 /* NetworkProcess */,
 				BC122FA51327085D00F7EAC1 /* PluginProcess */,
 				E1EDFD9716287AEC0039ECDA /* SharedWorkerProcess */,
@@ -5135,6 +5138,7 @@
 				8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
 				BC9FA522160D4A0C0054DF9A /* com.apple.WebKit.PluginProcess.sb in Resources */,
 				BC9FA523160D4A0F0054DF9A /* com.apple.WebProcess.sb in Resources */,
+				1CBC945E16515ED200D68AAE /* Dock.pdf in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (134345 => 134346)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2012-11-13 04:05:09 UTC (rev 134346)
@@ -143,6 +143,12 @@
     m_page->corePage()->inspectorController()->close();
 }
 
+void WebInspector::setAttachedWindow(bool attached)
+{
+    if (m_frontendClient)
+        m_frontendClient->setAttachedWindow(attached);
+}
+
 void WebInspector::evaluateScriptForTest(long callID, const String& script)
 {
     m_page->corePage()->inspectorController()->evaluateForTestInFrontend(callID, script);
@@ -236,8 +242,12 @@
 
 void WebInspector::updateDockingAvailability()
 {
-    if (m_frontendClient)
-        m_frontendClient->setDockingUnavailable(!m_frontendClient->canAttachWindow());
+    if (!m_frontendClient)
+        return;
+
+    bool canAttachWindow = m_frontendClient->canAttachWindow();
+    WebProcess::shared().connection()->send(Messages::WebInspectorProxy::AttachAvailabilityChanged(canAttachWindow), m_page->pageID());
+    m_frontendClient->setDockingUnavailable(!canAttachWindow);
 }
 
 #if ENABLE(INSPECTOR_SERVER)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h (134345 => 134346)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h	2012-11-13 04:05:09 UTC (rev 134346)
@@ -59,6 +59,8 @@
     void show();
     void close();
 
+    void setAttachedWindow(bool);
+
     void evaluateScriptForTest(long callID, const String& script);
 
     void setJavaScriptProfilingEnabled(bool);

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


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in	2012-11-13 04:03:41 UTC (rev 134345)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in	2012-11-13 04:05:09 UTC (rev 134346)
@@ -25,6 +25,7 @@
 messages -> WebInspector {
     Show()
     Close()
+    SetAttachedWindow(bool attached)
     ShowConsole()
     ShowResources()
     ShowMainResourceForFrame(uint64_t frameID)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to