#ifndef WebInspector_h
#define WebInspector_h
#if ENABLE(INSPECTOR)
#include "APIObject.h"
#include "Connection.h"
#include <wtf/Noncopyable.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class InspectorFrontendChannel;
}
namespace WebKit {
class WebInspectorFrontendClient;
class WebPage;
struct WebPageCreationParameters;
class WebInspector : public TypedAPIObject<APIObject::TypeBundleInspector> {
public:
static PassRefPtr<WebInspector> create(WebPage*, WebCore::InspectorFrontendChannel*);
WebPage* page() const { return m_page; }
WebPage* inspectorPage() const { return m_inspectorPage; }
void didReceiveWebInspectorMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
void show();
void close();
void didSave(const String& url);
void didAppend(const String& url);
void attachedBottom();
void attachedRight();
void detached();
void evaluateScriptForTest(long callID, const String& script);
void setJavaScriptProfilingEnabled(bool);
void startPageProfiling();
void stopPageProfiling();
#if ENABLE(INSPECTOR_SERVER)
bool hasRemoteFrontendConnected() const { return m_remoteFrontendConnected; }
void sendMessageToRemoteFrontend(const String& message);
void dispatchMessageFromRemoteFrontend(const String& message);
void remoteFrontendConnected();
void remoteFrontendDisconnected();
#endif
#if PLATFORM(MAC)
void setInspectorUsesWebKitUserInterface(bool);
#endif
private:
friend class WebInspectorClient;
friend class WebInspectorFrontendClient;
explicit WebInspector(WebPage*, WebCore::InspectorFrontendChannel*);
WebPage* createInspectorPage();
void destroyInspectorPage();
void didClose();
void bringToFront();
void inspectedURLChanged(const String&);
bool canSave() const;
void save(const String& filename, const String& content, bool forceSaveAs);
void append(const String& filename, const String& content);
void attachBottom();
void attachRight();
void detach();
void setAttachedWindowHeight(unsigned);
void setAttachedWindowWidth(unsigned);
void setToolbarHeight(unsigned);
String localizedStringsURL() const;
void showConsole();
void showResources();
void showMainResourceForFrame(uint64_t frameID);
void startJavaScriptDebugging();
void stopJavaScriptDebugging();
void startJavaScriptProfiling();
void stopJavaScriptProfiling();
void updateDockingAvailability();
WebPage* m_page;
WebPage* m_inspectorPage;
WebInspectorFrontendClient* m_frontendClient;
WebCore::InspectorFrontendChannel* m_frontendChannel;
#if PLATFORM(MAC)
mutable String m_localizedStringsURL;
mutable bool m_hasLocalizedStringsURL;
bool m_usesWebKitUserInterface;
#endif
#if ENABLE(INSPECTOR_SERVER)
bool m_remoteFrontendConnected;
#endif
};
}
#endif // ENABLE(INSPECTOR)
#endif // WebInspector_h