2011-01-25 Yury Semikhatsky <yurys@chromium.org>
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jan 2011 16:09:03 +0000 (16:09 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jan 2011 16:09:03 +0000 (16:09 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: remove "attached" state related methods from InspectorAgent
        https://bugs.webkit.org/show_bug.cgi?id=53086

        * WebCore.exp.in:
        * inspector/InspectorAgent.cpp:
        * inspector/InspectorAgent.h:
        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
        (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
        * inspector/InspectorSettings.cpp:
        (WebCore::InspectorSettings::InspectorSettings):
        * inspector/InspectorSettings.h:
2011-01-25  Yury Semikhatsky  <yurys@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: remove "attached" state related methods from InspectorAgent
        https://bugs.webkit.org/show_bug.cgi?id=53086

        * WebCoreSupport/WebInspectorClientCF.cpp:
        (WebInspectorClient::sendMessageToFrontend):
        (WebInspectorClient::inspectorStartsAttached):
        (WebInspectorClient::setInspectorStartsAttached):
        (WebInspectorClient::releaseFrontendPage):
2011-01-25  Yury Semikhatsky  <yurys@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: remove "attached" state related methods from InspectorAgent
        https://bugs.webkit.org/show_bug.cgi?id=53086

        * WebCoreSupport/WebInspectorClient.h:
        * WebCoreSupport/WebInspectorClient.mm:
        (-[WebInspectorWindowController showWindow:]):
        (-[WebInspectorWindowController attach]):
        (-[WebInspectorWindowController detach]):
2011-01-25  Yury Semikhatsky  <yurys@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: remove "attached" state related methods from InspectorAgent
        https://bugs.webkit.org/show_bug.cgi?id=53086

        * WebCoreSupport/WebInspectorClient.cpp:
        (WebInspectorFrontendClient::attachWindow):
        (WebInspectorFrontendClient::detachWindow):
        (WebInspectorFrontendClient::showWindowWithoutNotifications):
        * WebCoreSupport/WebInspectorClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76594 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/InspectorAgent.cpp
Source/WebCore/inspector/InspectorAgent.h
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorSettings.cpp
Source/WebCore/inspector/InspectorSettings.h
Source/WebKit/cf/ChangeLog
Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit/win/WebCoreSupport/WebInspectorClient.h

index 46fe612..f29c7be 100644 (file)
@@ -1,3 +1,20 @@
+2011-01-25  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: remove "attached" state related methods from InspectorAgent
+        https://bugs.webkit.org/show_bug.cgi?id=53086
+
+        * WebCore.exp.in:
+        * inspector/InspectorAgent.cpp:
+        * inspector/InspectorAgent.h:
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
+        (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
+        * inspector/InspectorSettings.cpp:
+        (WebCore::InspectorSettings::InspectorSettings):
+        * inspector/InspectorSettings.h:
+
 2011-01-25  Qi Zhang  <qi.2.zhang@nokia.com>
 
         Reviewed by Laszlo Gombos.
index 106b8f4..9b2117d 100644 (file)
@@ -1369,10 +1369,8 @@ __ZN7WebCore14InspectorAgent18disconnectFrontendEv
 __ZN7WebCore14InspectorAgent20stopTimelineProfilerEv
 __ZN7WebCore14InspectorAgent21showAndEnableDebuggerEv
 __ZN7WebCore14InspectorAgent21startTimelineProfilerEv
-__ZN7WebCore14InspectorAgent23inspectorStartsAttachedEv
 __ZN7WebCore14InspectorAgent25evaluateForTestInFrontendElRKN3WTF6StringE
 __ZN7WebCore14InspectorAgent26setInspectorFrontendClientEN3WTF10PassOwnPtrINS_23InspectorFrontendClientEEE
-__ZN7WebCore14InspectorAgent26setInspectorStartsAttachedEb
 __ZN7WebCore14InspectorAgent26stopUserInitiatedProfilingEv
 __ZN7WebCore14InspectorAgent27startUserInitiatedProfilingEv
 __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
index e5f26cd..4b342c7 100644 (file)
@@ -193,26 +193,6 @@ bool InspectorAgent::enabled() const
     return m_inspectedPage->settings()->developerExtrasEnabled();
 }
 
-bool InspectorAgent::inspectorStartsAttached()
-{
-    return m_settings->getBoolean(InspectorSettings::InspectorStartsAttached);
-}
-
-void InspectorAgent::setInspectorStartsAttached(bool attached)
-{
-    m_settings->setBoolean(InspectorSettings::InspectorStartsAttached, attached);
-}
-
-void InspectorAgent::setInspectorAttachedHeight(long height)
-{
-    m_settings->setLong(InspectorSettings::InspectorAttachedHeight, height);
-}
-
-long InspectorAgent::inspectorAttachedHeight() const
-{
-    return m_settings->getLong(InspectorSettings::InspectorAttachedHeight);
-}
-
 bool InspectorAgent::searchingForNodeInPage() const
 {
     return m_state->getBoolean(InspectorState::searchingForNode);
index 3ea1410..362abec 100644 (file)
@@ -257,11 +257,6 @@ public:
     void removeAllScriptsToEvaluateOnLoad();
     void setInspectorExtensionAPI(const String& source);
 
-    bool inspectorStartsAttached();
-    void setInspectorStartsAttached(bool);
-    void setInspectorAttachedHeight(long);
-    long inspectorAttachedHeight() const;
-
     InspectorState* state() { return m_state.get(); }
     InspectorSettings* settings() { return m_settings.get(); }
 
index 4812b2a..5e9b441 100644 (file)
@@ -38,6 +38,7 @@
 #include "Frame.h"
 #include "FrameView.h"
 #include "InspectorBackendDispatcher.h"
+#include "InspectorClient.h"
 #include "InspectorController.h"
 #include "InspectorFrontendHost.h"
 #include "Page.h"
@@ -47,6 +48,7 @@
 
 namespace WebCore {
 
+static const char* inspectorAttachedHeightSetting = "inspectorAttachedHeight";
 static const unsigned defaultAttachedHeight = 300;
 static const float minimumAttachedHeight = 250.0f;
 static const float maximumAttachedHeightRatio = 0.75f;
@@ -107,7 +109,7 @@ void InspectorFrontendClientLocal::changeAttachedWindowHeight(unsigned height)
 {
     unsigned totalHeight = m_frontendPage->mainFrame()->view()->visibleHeight() + m_inspectorController->inspectedPage()->mainFrame()->view()->visibleHeight();
     unsigned attachedHeight = constrainedAttachedWindowHeight(height, totalHeight);
-    m_inspectorController->setInspectorAttachedHeight(attachedHeight);
+    m_inspectorController->inspectorClient()->storeSetting(inspectorAttachedHeightSetting, String::number(attachedHeight));
     setAttachedWindowHeight(attachedHeight);
 }
 
@@ -133,9 +135,9 @@ void InspectorFrontendClientLocal::setAttachedWindow(bool attached)
 void InspectorFrontendClientLocal::restoreAttachedWindowHeight()
 {
     unsigned inspectedPageHeight = m_inspectorController->inspectedPage()->mainFrame()->view()->visibleHeight();
-    int attachedHeight = m_inspectorController->inspectorAttachedHeight();
-    bool success = true;
-    unsigned preferredHeight = success ? static_cast<unsigned>(attachedHeight) : defaultAttachedHeight;
+    String value;
+    m_inspectorController->inspectorClient()->populateSetting(inspectorAttachedHeightSetting, &value);
+    unsigned preferredHeight = value.isEmpty() ? defaultAttachedHeight : value.toUInt();
     
     // This call might not go through (if the window starts out detached), but if the window is initially created attached,
     // InspectorController::attachWindow is never called, so we need to make sure to set the attachedWindowHeight.
index 3ebc3ab..08c5645 100644 (file)
@@ -39,8 +39,6 @@ namespace WebCore {
 const char* InspectorSettings::MonitoringXHREnabled = "xhrMonitor";
 const char* InspectorSettings::ProfilerAlwaysEnabled = "profilerEnabled";
 const char* InspectorSettings::DebuggerAlwaysEnabled = "debuggerEnabled";
-const char* InspectorSettings::InspectorStartsAttached = "inspectorStartsAttached";
-const char* InspectorSettings::InspectorAttachedHeight = "inspectorAttachedHeight";
 
 InspectorSettings::InspectorSettings(InspectorClient* client)
     : m_client(client)
@@ -48,8 +46,6 @@ InspectorSettings::InspectorSettings(InspectorClient* client)
     registerBoolean(MonitoringXHREnabled, false);
     registerBoolean(ProfilerAlwaysEnabled, false);
     registerBoolean(DebuggerAlwaysEnabled, false);
-    registerBoolean(InspectorStartsAttached, true);
-    registerLong(InspectorAttachedHeight, 300);
 }
 
 bool InspectorSettings::getBoolean(const String& name)
index 717d11f..0d48570 100644 (file)
@@ -47,8 +47,6 @@ public:
     static const char* MonitoringXHREnabled;
     static const char* ProfilerAlwaysEnabled;
     static const char* DebuggerAlwaysEnabled;
-    static const char* InspectorStartsAttached;
-    static const char* InspectorAttachedHeight;
 
     InspectorSettings(InspectorClient* client);
 
index f712c97..9812efa 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-25  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: remove "attached" state related methods from InspectorAgent
+        https://bugs.webkit.org/show_bug.cgi?id=53086
+
+        * WebCoreSupport/WebInspectorClientCF.cpp:
+        (WebInspectorClient::sendMessageToFrontend):
+        (WebInspectorClient::inspectorStartsAttached):
+        (WebInspectorClient::setInspectorStartsAttached):
+        (WebInspectorClient::releaseFrontendPage):
+
 2011-01-03  Pratik Solanki  <psolanki@apple.com>
 
         Mac build fix. Define WTF_USE_CFNETWORK for Windows build only.
index 9183fa4..cefe544 100644 (file)
@@ -65,6 +65,8 @@
 
 using namespace WebCore;
 
+static const char* inspectorStartsAttachedSetting = "inspectorStartsAttached";
+
 static inline CFStringRef createKeyForPreferences(const String& key)
 {
     RetainPtr<CFStringRef> keyCFString(AdoptCF, key.createCFString());
@@ -98,12 +100,24 @@ void WebInspectorClient::storeSetting(const String& key, const String& setting)
     CFPreferencesSetAppValue(preferencesKey.get(), objectToStore.get(), kCFPreferencesCurrentApplication);
 }
 
-void WebInspectorClient::releaseFrontendPage()
+bool WebInspectorClient::sendMessageToFrontend(const String& message)
 {
-    m_frontendPage = 0;
+    return doDispatchMessageOnFrontendPage(m_frontendPage, message);
 }
 
-bool WebInspectorClient::sendMessageToFrontend(const String& message)
+bool WebInspectorClient::inspectorStartsAttached()
 {
-    return doDispatchMessageOnFrontendPage(m_frontendPage, message);
+    String value;
+    populateSetting(inspectorStartsAttachedSetting, &value);
+    return value == "true";
+}
+
+void WebInspectorClient::setInspectorStartsAttached(bool attached)
+{
+    storeSetting(inspectorStartsAttachedSetting, attached ? "true" : "false");
+}
+
+void WebInspectorClient::releaseFrontendPage()
+{
+    m_frontendPage = 0;
 }
index 02df835..0e710c7 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-25  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: remove "attached" state related methods from InspectorAgent
+        https://bugs.webkit.org/show_bug.cgi?id=53086
+
+        * WebCoreSupport/WebInspectorClient.h:
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController showWindow:]):
+        (-[WebInspectorWindowController attach]):
+        (-[WebInspectorWindowController detach]):
+
 2011-01-23  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by John Sullivan.
index 75a3cc6..cb928e5 100644 (file)
@@ -64,6 +64,9 @@ public:
 
     virtual bool sendMessageToFrontend(const WTF::String&);
 
+    bool inspectorStartsAttached();
+    void setInspectorStartsAttached(bool);
+
     void releaseFrontendPage();
 
 private:
index 5beedcf..18746b3 100644 (file)
@@ -355,9 +355,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
 
     _visible = YES;
     
-    // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
-    // FIXME: This flag can be fetched directly from the flags storage.
-    _shouldAttach = [_inspectedWebView page]->inspectorController()->inspectorStartsAttached();
+    _shouldAttach = _inspectorClient->inspectorStartsAttached();
     
     if (_shouldAttach && !_frontendClient->canAttachWindow())
         _shouldAttach = NO;
@@ -392,8 +390,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
     if (_attachedToInspectedWebView)
         return;
 
-    // FIXME: This flag can be saved directly to the flags storage.
-    [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(true);
+    _inspectorClient->setInspectorStartsAttached(true);
 
     [self close];
     [self showWindow:nil];
@@ -404,8 +401,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const
     if (!_attachedToInspectedWebView)
         return;
 
-    // FIXME: This flag can be saved to the flags storage directly.
-    [_inspectedWebView page]->inspectorController()->setInspectorStartsAttached(false);
+    _inspectorClient->setInspectorStartsAttached(false);
 
     [self close];
     [self showWindow:nil];
index cefedc7..d529ded 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-25  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: remove "attached" state related methods from InspectorAgent
+        https://bugs.webkit.org/show_bug.cgi?id=53086
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorFrontendClient::attachWindow):
+        (WebInspectorFrontendClient::detachWindow):
+        (WebInspectorFrontendClient::showWindowWithoutNotifications):
+        * WebCoreSupport/WebInspectorClient.h:
+
 2011-01-24  Adam Roben  <aroben@apple.com>
 
         Windows Production build fix
index 76ebc8f..dee2516 100644 (file)
@@ -271,8 +271,7 @@ void WebInspectorFrontendClient::attachWindow()
     if (m_attached)
         return;
 
-    // FIXME: This flag can be saved to the flags storage directly.
-    m_inspectedWebView->page()->inspectorController()->setInspectorStartsAttached(true);
+    m_inspectorClient->setInspectorStartsAttached(true);
 
     closeWindowWithoutNotifications();
     showWindowWithoutNotifications();
@@ -283,8 +282,7 @@ void WebInspectorFrontendClient::detachWindow()
     if (!m_attached)
         return;
 
-    // FIXME: This flag can be saved to the flags storage directly.
-    m_inspectedWebView->page()->inspectorController()->setInspectorStartsAttached(false);
+    m_inspectorClient->setInspectorStartsAttached(false);
 
     closeWindowWithoutNotifications();
     showWindowWithoutNotifications();
@@ -365,7 +363,7 @@ void WebInspectorFrontendClient::showWindowWithoutNotifications()
     else {
         // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
         // FIXME: This flag can be fetched directly from the flags storage.
-        shouldAttach = m_inspectedWebView->page()->inspectorController()->inspectorStartsAttached();
+        shouldAttach = m_inspectorClient->inspectorStartsAttached();
 
         if (shouldAttach && !canAttachWindow())
             shouldAttach = false;
index 0c38247..2c4bcdf 100644 (file)
@@ -63,6 +63,11 @@ public:
 
     virtual bool sendMessageToFrontend(const WTF::String&);
 
+    bool inspectorStartsAttached();
+    void setInspectorStartsAttached(bool);
+
+    void releaseFrontendPage();
+
     void updateHighlight();
     void frontendClosing()
     {
@@ -70,7 +75,6 @@ public:
         releaseFrontendPage();
     }
 
-    void releaseFrontendPage();
 private:
     ~WebInspectorClient();