Title: [147482] trunk/Source/WebKit
Revision
147482
Author
timo...@apple.com
Date
2013-04-02 12:06:39 -0700 (Tue, 02 Apr 2013)

Log Message

Provide a user default that can be used to disable docking of the Web Inspector.

The user default is "WebKit Web Inspector Setting - inspectorAttachDisabled".

https://webkit.org/b/113779
rdar://problem/13446021

Reviewed by Joseph Pecoraro.

Source/WebKit/cf:

* WebCoreSupport/WebInspectorClientCF.cpp:
(WebInspectorClient::inspectorAttachDisabled): Added.
(WebInspectorClient::setInspectorAttachDisabled): Added.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorClient::inspectorAttachDisabled): Added.
(WebInspectorClient::setInspectorAttachDisabled): Added.

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::didResizeMainFrame):
(-[WebInspectorWindowController window]):
(-[WebInspectorWindowController showWindow:]):
Check inspectorAttachDisabled() in places where we attach or update the dock button.

Source/WebKit/win:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorClient::inspectorAttachDisabled): Added.
(WebInspectorClient::setInspectorAttachDisabled): Added.

Modified Paths

Diff

Modified: trunk/Source/WebKit/cf/ChangeLog (147481 => 147482)


--- trunk/Source/WebKit/cf/ChangeLog	2013-04-02 18:56:51 UTC (rev 147481)
+++ trunk/Source/WebKit/cf/ChangeLog	2013-04-02 19:06:39 UTC (rev 147482)
@@ -1,3 +1,18 @@
+2013-04-02  Timothy Hatcher  <timo...@apple.com>
+
+        Provide a user default that can be used to disable docking of the Web Inspector.
+
+        The user default is "WebKit Web Inspector Setting - inspectorAttachDisabled".
+
+        https://webkit.org/b/113779
+        rdar://problem/13446021
+
+        Reviewed by Joseph Pecoraro.
+
+        * WebCoreSupport/WebInspectorClientCF.cpp:
+        (WebInspectorClient::inspectorAttachDisabled): Added.
+        (WebInspectorClient::setInspectorAttachDisabled): Added.
+
 2012-10-29  Anders Carlsson  <ander...@apple.com>
 
         String::createCFString should return a RetainPtr

Modified: trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp (147481 => 147482)


--- trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp	2013-04-02 18:56:51 UTC (rev 147481)
+++ trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp	2013-04-02 19:06:39 UTC (rev 147482)
@@ -62,6 +62,7 @@
 using namespace WebCore;
 
 static const char* inspectorStartsAttachedSetting = "inspectorStartsAttached";
+static const char* inspectorAttachDisabledSetting = "inspectorAttachDisabled";
 
 static inline RetainPtr<CFStringRef> createKeyForPreferences(const String& key)
 {
@@ -95,6 +96,20 @@
     return doDispatchMessageOnFrontendPage(m_frontendPage, message);
 }
 
+bool WebInspectorClient::inspectorAttachDisabled()
+{
+    String value;
+    populateSetting(inspectorAttachDisabledSetting, &value);
+    if (value.isEmpty())
+        return false;
+    return value == "true";
+}
+
+void WebInspectorClient::setInspectorAttachDisabled(bool disabled)
+{
+    storeSetting(inspectorAttachDisabledSetting, disabled ? "true" : "false");
+}
+
 bool WebInspectorClient::inspectorStartsAttached()
 {
     String value;

Modified: trunk/Source/WebKit/mac/ChangeLog (147481 => 147482)


--- trunk/Source/WebKit/mac/ChangeLog	2013-04-02 18:56:51 UTC (rev 147481)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-04-02 19:06:39 UTC (rev 147482)
@@ -1,3 +1,24 @@
+2013-04-02  Timothy Hatcher  <timo...@apple.com>
+
+        Provide a user default that can be used to disable docking of the Web Inspector.
+
+        The user default is "WebKit Web Inspector Setting - inspectorAttachDisabled".
+
+        https://webkit.org/b/113779
+        rdar://problem/13446021
+
+        Reviewed by Joseph Pecoraro.
+
+        * WebCoreSupport/WebInspectorClient.h:
+        (WebInspectorClient::inspectorAttachDisabled): Added.
+        (WebInspectorClient::setInspectorAttachDisabled): Added.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (WebInspectorClient::didResizeMainFrame):
+        (-[WebInspectorWindowController window]):
+        (-[WebInspectorWindowController showWindow:]):
+        Check inspectorAttachDisabled() in places where we attach or update the dock button.
+
 2013-04-02  Alexey Proskuryakov  <a...@apple.com>
 
         <rdar://problem/13551119> [WK2] Crashes in NetworkProcess when canceling loads

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h (147481 => 147482)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h	2013-04-02 18:56:51 UTC (rev 147481)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h	2013-04-02 19:06:39 UTC (rev 147482)
@@ -76,6 +76,9 @@
     bool inspectorStartsAttached();
     void setInspectorStartsAttached(bool);
 
+    bool inspectorAttachDisabled();
+    void setInspectorAttachDisabled(bool);
+
     void releaseFrontend();
 
 private:

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm (147481 => 147482)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2013-04-02 18:56:51 UTC (rev 147481)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2013-04-02 19:06:39 UTC (rev 147482)
@@ -162,7 +162,7 @@
 void WebInspectorClient::didResizeMainFrame(Frame*)
 {
     if (m_frontendClient)
-        m_frontendClient->attachAvailabilityChanged(m_frontendClient->canAttachWindow());
+        m_frontendClient->attachAvailabilityChanged(m_frontendClient->canAttachWindow() && !inspectorAttachDisabled());
 }
 
 void WebInspectorClient::highlight()
@@ -469,7 +469,7 @@
     [frameView addSubview:_dockButton.get()];
 
     // Hide the dock button if we can't attach.
-    _dockButton.get().hidden = !_frontendClient->canAttachWindow();
+    _dockButton.get().hidden = !_frontendClient->canAttachWindow() || _inspectorClient->inspectorAttachDisabled();
 
     [self setWindow:window];
     [window release];
@@ -538,10 +538,7 @@
 
     _visible = YES;
     
-    _shouldAttach = _inspectorClient->inspectorStartsAttached();
-    
-    if (_shouldAttach && !_frontendClient->canAttachWindow())
-        _shouldAttach = NO;
+    _shouldAttach = _inspectorClient->inspectorStartsAttached() && _frontendClient->canAttachWindow() && !_inspectorClient->inspectorAttachDisabled();
 
     if (_shouldAttach) {
         WebFrameView *frameView = [[_inspectedWebView.get() mainFrame] frameView];

Modified: trunk/Source/WebKit/win/ChangeLog (147481 => 147482)


--- trunk/Source/WebKit/win/ChangeLog	2013-04-02 18:56:51 UTC (rev 147481)
+++ trunk/Source/WebKit/win/ChangeLog	2013-04-02 19:06:39 UTC (rev 147482)
@@ -1,3 +1,18 @@
+2013-04-02  Timothy Hatcher  <timo...@apple.com>
+
+        Provide a user default that can be used to disable docking of the Web Inspector.
+
+        The user default is "WebKit Web Inspector Setting - inspectorAttachDisabled".
+
+        https://webkit.org/b/113779
+        rdar://problem/13446021
+
+        Reviewed by Joseph Pecoraro.
+
+        * WebCoreSupport/WebInspectorClient.h:
+        (WebInspectorClient::inspectorAttachDisabled): Added.
+        (WebInspectorClient::setInspectorAttachDisabled): Added.
+
 2013-03-28  Matt Falkenhagen  <fal...@chromium.org>
 
         Refactoring: Replace Element::disabled and isEnabledFormControl with isDisabledFormControl

Modified: trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h (147481 => 147482)


--- trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h	2013-04-02 18:56:51 UTC (rev 147481)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h	2013-04-02 19:06:39 UTC (rev 147482)
@@ -70,6 +70,9 @@
     bool inspectorStartsAttached();
     void setInspectorStartsAttached(bool);
 
+    bool inspectorAttachDisabled();
+    void setInspectorAttachDisabled(bool);
+
     void releaseFrontend();
 
     WebInspectorFrontendClient* frontendClient() { return m_frontendClient; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to