#ifndef PageDebuggerAgent_h
#define PageDebuggerAgent_h
#include "bindings/v8/PageScriptDebugServer.h"
#include "core/inspector/InspectorDebuggerAgent.h"
#include "core/inspector/InspectorOverlayHost.h"
namespace WebCore {
class DocumentLoader;
class InspectorOverlay;
class InspectorPageAgent;
class Page;
class PageScriptDebugServer;
class ScriptSourceCode;
class PageDebuggerAgent FINAL :
public InspectorDebuggerAgent,
public InspectorOverlayHost::Listener {
WTF_MAKE_NONCOPYABLE(PageDebuggerAgent);
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<PageDebuggerAgent> create(PageScriptDebugServer*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
virtual ~PageDebuggerAgent();
void didClearWindowObjectInMainWorld(LocalFrame*);
String preprocessEventListener(LocalFrame*, const String& source, const String& url, const String& functionName);
PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSourceCode&);
void didCommitLoad(LocalFrame*, DocumentLoader*);
protected:
virtual void enable() OVERRIDE;
virtual void disable() OVERRIDE;
private:
virtual void startListeningScriptDebugServer() OVERRIDE;
virtual void stopListeningScriptDebugServer() OVERRIDE;
virtual PageScriptDebugServer& scriptDebugServer() OVERRIDE;
virtual void muteConsole() OVERRIDE;
virtual void unmuteConsole() OVERRIDE;
virtual void overlayResumed() OVERRIDE;
virtual void overlaySteppedOver() OVERRIDE;
virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) OVERRIDE;
virtual void setOverlayMessage(ErrorString*, const String*) OVERRIDE;
PageDebuggerAgent(PageScriptDebugServer*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
PageScriptDebugServer* m_pageScriptDebugServer;
InspectorPageAgent* m_pageAgent;
InspectorOverlay* m_overlay;
};
}
#endif