2 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef WebDevToolsAgentImpl_h
32 #define WebDevToolsAgentImpl_h
34 #include "InspectorClient.h"
36 #include "PageOverlay.h"
37 #include "WebDevToolsAgentPrivate.h"
39 #include <wtf/Forward.h>
40 #include <wtf/OwnPtr.h>
45 class GraphicsContext;
46 class InspectorClient;
47 class InspectorController;
53 class WebDevToolsAgentClient;
61 struct WebDevToolsMessageData;
63 class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate,
64 public WebCore::InspectorClient,
65 public PageOverlay::PageOverlayClient {
67 WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* client);
68 virtual ~WebDevToolsAgentImpl();
70 // WebDevToolsAgentPrivate implementation.
71 virtual void didClearWindowObject(WebFrameImpl* frame);
73 // WebDevToolsAgent implementation.
74 virtual void attach();
75 virtual void reattach(const WebString& savedState);
76 virtual void detach();
77 virtual void didNavigate();
78 virtual void dispatchOnInspectorBackend(const WebString& message);
79 virtual void inspectElementAt(const WebPoint& point);
80 virtual void evaluateInWebInspector(long callId, const WebString& script);
81 virtual void setJavaScriptProfilingEnabled(bool);
82 virtual void setProcessId(long);
84 // InspectorClient implementation.
85 virtual void inspectorDestroyed();
86 virtual void openInspectorFrontend(WebCore::InspectorController*);
87 virtual void closeInspectorFrontend();
89 virtual void bringFrontendToFront();
90 virtual void highlight();
91 virtual void hideHighlight();
92 virtual void updateInspectorStateCookie(const WTF::String&);
93 virtual bool sendMessageToFrontend(const WTF::String&);
95 virtual void clearBrowserCache();
96 virtual void clearBrowserCookies();
98 int hostId() { return m_hostId; }
101 virtual void paintPageOverlay(WebCore::GraphicsContext&);
104 WebCore::InspectorController* inspectorController();
105 WebCore::Frame* mainFrame();
108 WebDevToolsAgentClient* m_client;
109 WebViewImpl* m_webViewImpl;
113 } // namespace WebKit