InspectorFrontendClientLocal.h [plain text]
#ifndef InspectorFrontendClientLocal_h
#define InspectorFrontendClientLocal_h
#include "InspectorFrontendClient.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class Frame;
class InspectorController;
class InspectorBackendDispatchTask;
class InspectorFrontendHost;
class Page;
class InspectorFrontendClientLocal : public InspectorFrontendClient {
WTF_MAKE_NONCOPYABLE(InspectorFrontendClientLocal); WTF_MAKE_FAST_ALLOCATED;
public:
class Settings {
public:
Settings() { }
virtual ~Settings() { }
virtual String getProperty(const String& name);
virtual void setProperty(const String& name, const String& value);
};
InspectorFrontendClientLocal(InspectorController*, Page*, std::unique_ptr<Settings>);
virtual ~InspectorFrontendClientLocal();
virtual void windowObjectCleared() override;
virtual void frontendLoaded() override;
virtual void moveWindowBy(float x, float y) override;
virtual void requestSetDockSide(DockSide) override;
virtual void changeAttachedWindowHeight(unsigned) override;
virtual void changeAttachedWindowWidth(unsigned) override;
virtual void openInNewTab(const String& url) override;
virtual bool canSave() override { return false; }
virtual void save(const String&, const String&, bool, bool) override { }
virtual void append(const String&, const String&) override { }
virtual void attachWindow(DockSide) = 0;
virtual void detachWindow() = 0;
virtual void sendMessageToBackend(const String& message) override;
virtual bool isUnderTest() override;
bool canAttachWindow();
void setDockingUnavailable(bool);
static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight);
static unsigned constrainedAttachedWindowWidth(unsigned preferredWidth, unsigned totalWindowWidth);
bool isDebuggingEnabled();
void setDebuggingEnabled(bool);
bool isTimelineProfilingEnabled();
void setTimelineProfilingEnabled(bool);
bool isProfilingJavaScript();
void startProfilingJavaScript();
void stopProfilingJavaScript();
void showConsole();
void showMainResourceForFrame(Frame*);
void showResources();
void setAttachedWindow(DockSide);
protected:
virtual void setAttachedWindowHeight(unsigned) = 0;
virtual void setAttachedWindowWidth(unsigned) = 0;
void restoreAttachedWindowHeight();
private:
bool evaluateAsBoolean(const String& expression);
void evaluateOnLoad(const String& expression);
friend class FrontendMenuProvider;
InspectorController* m_inspectorController;
Page* m_frontendPage;
RefPtr<InspectorFrontendHost> m_frontendHost;
std::unique_ptr<InspectorFrontendClientLocal::Settings> m_settings;
bool m_frontendLoaded;
DockSide m_dockSide;
Vector<String> m_evaluateOnLoad;
std::unique_ptr<InspectorBackendDispatchTask> m_dispatchTask;
};
}
#endif