#ifndef InspectorInspectorAgent_h
#define InspectorInspectorAgent_h
#include "core/inspector/InspectorBaseAgent.h"
#include "wtf/HashMap.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/Vector.h"
namespace WebCore {
class DOMWrapperWorld;
class DocumentLoader;
class LocalFrame;
class InjectedScriptManager;
class InspectorFrontend;
class InstrumentingAgents;
class JSONObject;
class Page;
typedef String ErrorString;
class InspectorInspectorAgent FINAL : public InspectorBaseAgent<InspectorInspectorAgent>, public InspectorBackendDispatcher::InspectorCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorInspectorAgent);
public:
static PassOwnPtr<InspectorInspectorAgent> create(Page* page, InjectedScriptManager* injectedScriptManager)
{
return adoptPtr(new InspectorInspectorAgent(page, injectedScriptManager));
}
virtual ~InspectorInspectorAgent();
virtual void enable(ErrorString*) OVERRIDE;
virtual void disable(ErrorString*) OVERRIDE;
virtual void reset(ErrorString*) OVERRIDE;
virtual void init() OVERRIDE;
virtual void setFrontend(InspectorFrontend*) OVERRIDE;
virtual void clearFrontend() OVERRIDE;
void didClearWindowObjectInMainWorld(LocalFrame*);
void didCommitLoad(LocalFrame*, DocumentLoader*);
void domContentLoadedEventFired(LocalFrame*);
bool hasFrontend() const { return m_frontend; }
void evaluateForTestInFrontend(long testCallId, const String& script);
void setInjectedScriptForOrigin(const String& origin, const String& source);
void inspect(PassRefPtr<TypeBuilder::Runtime::RemoteObject> objectToInspect, PassRefPtr<JSONObject> hints);
private:
InspectorInspectorAgent(Page*, InjectedScriptManager*);
Page* m_inspectedPage;
InspectorFrontend* m_frontend;
InjectedScriptManager* m_injectedScriptManager;
Vector<pair<long, String> > m_pendingEvaluateTestCommands;
pair<RefPtr<TypeBuilder::Runtime::RemoteObject>, RefPtr<JSONObject> > m_pendingInspectData;
typedef HashMap<String, String> InjectedScriptForOriginMap;
InjectedScriptForOriginMap m_injectedScriptForOrigin;
};
}
#endif