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 46fe61276d37faedc589854e8e5337062ab2bd0b..f29c7bead5bcb62dd8c8528914064ebff1cf0d69 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 106b8f4df90ad5afefc44eee61f30203b6349518..9b2117dfa0ce83604d22d315eae93881125afc77 100644 (file)
@@ -1369,10 +1369,8 @@ __ZN7WebCore14InspectorAgent18disconnectFrontendEv
 __ZN7WebCore14InspectorAgent20stopTimelineProfilerEv
 __ZN7WebCore14InspectorAgent21showAndEnableDebuggerEv
 __ZN7WebCore14InspectorAgent21startTimelineProfilerEv
-__ZN7WebCore14InspectorAgent23inspectorStartsAttachedEv
 __ZN7WebCore14InspectorAgent25evaluateForTestInFrontendElRKN3WTF6StringE
 __ZN7WebCore14InspectorAgent26setInspectorFrontendClientEN3WTF10PassOwnPtrINS_23InspectorFrontendClientEEE
-__ZN7WebCore14InspectorAgent26setInspectorStartsAttachedEb
 __ZN7WebCore14InspectorAgent26stopUserInitiatedProfilingEv
 __ZN7WebCore14InspectorAgent27startUserInitiatedProfilingEv
 __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
index e5f26cd1d85580f302720d94657331bfe58253a5..4b342c7a2f8aefb21d714f364183525f52d46bd3 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 3ea1410d9a1d914ff5b3bcaca21e4a0da1fb2187..362abec29ebf99dbf6ca3db36dedfdd4312e8f9a 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 4812b2a2dd3bb49e791aa2cd4f75c7caeb7e328d..5e9b44133ce94bc402e08fb9160fd0800c54e6ac 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 3ebc3abdcf1d221ed234e5ad2667cae2a81f4f8b..08c56451a6d65111369994601fa1c66db9afb0aa 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 717d11f0d72a18f152a37fc628d4268bc788fba4..0d4857001050e20a19b5d4c1b711c501655f57c3 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 f712c9737e6a2e3a93fda86c25f7b14d6d0bf54e..9812efab4c7be9943777e8f7f8cdfcd5edaf27cd 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 9183fa4485002da0863f0be8d5a3f73f16906908..cefe544f6db2e543658a331338999f8662847ee7 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 02df83501156b30cff8500e868d80b52feb0d8a4..0e710c7f8942066c4c96d5ca8aa3b7a1566724df 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 75a3cc6c499913a161630b2401988c587a33ccd2..cb928e5da2113ceed84f4856c567e7899b5e82fe 100644 (file)
@@ -64,6 +64,9 @@ public:
 
     virtual bool sendMessageToFrontend(const WTF::String&);
 
+    bool inspectorStartsAttached();
+    void setInspectorStartsAttached(bool);
+
     void releaseFrontendPage();
 
 private:
index 5beedcfee4f309fc70fbf063562a82d6b8d1d05f..18746b3eb91177f2a708ab3bbed7b8dedf39db15 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 cefedc71eb5ef8591b21b1bf776373a7dbbbb30a..d529ded2bb87c246c0108220e99b696febae5f93 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 76ebc8f6d25c15c3a94722e621599310e7260701..dee2516aa8e7680e85fa4791a122f62adb05c77d 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 0c38247ea59be0996adf72c1c8776fb07e148859..2c4bcdf530e2567d14e898d401615f64f78cf1eb 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();