WebInspectorClient.h [plain text]
#ifndef WebInspectorClient_h
#define WebInspectorClient_h
#include <WebCore/COMPtr.h>
#include <WebCore/InspectorClient.h>
#include <WebCore/InspectorFrontendClientLocal.h>
#include <WebCore/PlatformString.h>
#include <WebCore/WindowMessageListener.h>
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/text/StringHash.h>
#include <windows.h>
namespace WebCore {
class Page;
}
class WebNodeHighlight;
class WebView;
class WebInspectorClient : public WebCore::InspectorClient {
public:
WebInspectorClient(WebView*);
virtual void inspectorDestroyed();
virtual void openInspectorFrontend(WebCore::InspectorController*);
virtual void highlight(WebCore::Node*);
virtual void hideHighlight();
virtual bool sendMessageToFrontend(const WTF::String&);
bool inspectorStartsAttached();
void setInspectorStartsAttached(bool);
void releaseFrontendPage();
void updateHighlight();
void frontendClosing()
{
m_frontendHwnd = 0;
releaseFrontendPage();
}
void saveSessionSetting(const WTF::String& key, const WTF::String& value);
void loadSessionSetting(const WTF::String& key, WTF::String* value);
private:
virtual ~WebInspectorClient();
WTF::PassOwnPtr<WebCore::InspectorFrontendClientLocal::Settings> createFrontendSettings();
WebView* m_inspectedWebView;
WebCore::Page* m_frontendPage;
HWND m_inspectedWebViewHwnd;
HWND m_frontendHwnd;
OwnPtr<WebNodeHighlight> m_highlight;
WTF::HashMap<WTF::String, WTF::String> m_sessionSettings;
};
class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal, WebCore::WindowMessageListener {
public:
WebInspectorFrontendClient(WebView* inspectedWebView, HWND inspectedWebViewHwnd, HWND frontendHwnd, const COMPtr<WebView>& frotnendWebView, HWND frontendWebViewHwnd, WebInspectorClient*, WTF::PassOwnPtr<Settings>);
virtual ~WebInspectorFrontendClient();
virtual void frontendLoaded();
virtual WTF::String localizedStringsURL();
virtual WTF::String hiddenPanels();
virtual void bringToFront();
virtual void closeWindow();
virtual void disconnectFromBackend();
virtual void attachWindow();
virtual void detachWindow();
virtual void setAttachedWindowHeight(unsigned height);
virtual void inspectedURLChanged(const WTF::String& newURL);
virtual void saveSessionSetting(const WTF::String& key, const WTF::String& value);
virtual void loadSessionSetting(const WTF::String& key, WTF::String* value);
private:
void closeWindowWithoutNotifications();
void showWindowWithoutNotifications();
void destroyInspectorView(bool notifyInspectorController);
void updateWindowTitle();
LRESULT onGetMinMaxInfo(WPARAM, LPARAM);
LRESULT onSize(WPARAM, LPARAM);
LRESULT onClose(WPARAM, LPARAM);
LRESULT onSetFocus();
virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM);
void onWebViewWindowPosChanging(WPARAM, LPARAM);
WebView* m_inspectedWebView;
HWND m_inspectedWebViewHwnd;
HWND m_frontendHwnd;
WebInspectorClient* m_inspectorClient;
COMPtr<WebView> m_frontendWebView;
HWND m_frontendWebViewHwnd;
bool m_attached;
WTF::String m_inspectedURL;
bool m_destroyingInspectorView;
static friend LRESULT CALLBACK WebInspectorWndProc(HWND, UINT, WPARAM, LPARAM);
};
#endif // !defined(WebInspectorClient_h)