Commit d8b7ab36 authored by yurys@chromium.org's avatar yurys@chromium.org
Browse files

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  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: http://svn.webkit.org/repository/webkit/trunk@76594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 91220f5b
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.
......@@ -1369,10 +1369,8 @@ __ZN7WebCore14InspectorAgent18disconnectFrontendEv
__ZN7WebCore14InspectorAgent20stopTimelineProfilerEv
__ZN7WebCore14InspectorAgent21showAndEnableDebuggerEv
__ZN7WebCore14InspectorAgent21startTimelineProfilerEv
__ZN7WebCore14InspectorAgent23inspectorStartsAttachedEv
__ZN7WebCore14InspectorAgent25evaluateForTestInFrontendElRKN3WTF6StringE
__ZN7WebCore14InspectorAgent26setInspectorFrontendClientEN3WTF10PassOwnPtrINS_23InspectorFrontendClientEEE
__ZN7WebCore14InspectorAgent26setInspectorStartsAttachedEb
__ZN7WebCore14InspectorAgent26stopUserInitiatedProfilingEv
__ZN7WebCore14InspectorAgent27startUserInitiatedProfilingEv
__ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
......
......@@ -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);
......
......@@ -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(); }
......
......@@ -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.
......
......@@ -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)
......
......@@ -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);
......
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.
......
......@@ -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;
}
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.
......
......@@ -64,6 +64,9 @@ public:
virtual bool sendMessageToFrontend(const WTF::String&);
bool inspectorStartsAttached();
void setInspectorStartsAttached(bool);
void releaseFrontendPage();
private:
......
......@@ -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];
......
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
......
......@@ -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;
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment