tizen beta release
[framework/web/webkit-efl.git] / Source / WebKit / chromium / src / WebDevToolsAgentImpl.h
1 /*
2  * Copyright (C) 2010 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
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
13  * distribution.
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.
17  *
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.
29  */
30
31 #ifndef WebDevToolsAgentImpl_h
32 #define WebDevToolsAgentImpl_h
33
34 #include "InspectorClient.h"
35
36 #include "PageOverlay.h"
37 #include "WebDevToolsAgentPrivate.h"
38
39 #include <wtf/Forward.h>
40 #include <wtf/OwnPtr.h>
41
42 namespace WebCore {
43 class Document;
44 class Frame;
45 class GraphicsContext;
46 class InspectorClient;
47 class InspectorController;
48 class Node;
49 }
50
51 namespace WebKit {
52
53 class WebDevToolsAgentClient;
54 class WebFrame;
55 class WebFrameImpl;
56 class WebString;
57 class WebURLRequest;
58 class WebURLResponse;
59 class WebViewImpl;
60 struct WebURLError;
61 struct WebDevToolsMessageData;
62
63 class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate,
64                              public WebCore::InspectorClient,
65                              public PageOverlay::PageOverlayClient {
66 public:
67     WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* client);
68     virtual ~WebDevToolsAgentImpl();
69
70     // WebDevToolsAgentPrivate implementation.
71     virtual void didClearWindowObject(WebFrameImpl* frame);
72
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);
83
84     // InspectorClient implementation.
85     virtual void inspectorDestroyed();
86     virtual void openInspectorFrontend(WebCore::InspectorController*);
87     virtual void closeInspectorFrontend();
88
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&);
94
95     virtual void clearBrowserCache();
96     virtual void clearBrowserCookies();
97
98     int hostId() { return m_hostId; }
99
100     // PageOverlayClient
101     virtual void paintPageOverlay(WebCore::GraphicsContext&);
102
103 private:
104     WebCore::InspectorController* inspectorController();
105     WebCore::Frame* mainFrame();
106
107     int m_hostId;
108     WebDevToolsAgentClient* m_client;
109     WebViewImpl* m_webViewImpl;
110     bool m_attached;
111 };
112
113 } // namespace WebKit
114
115 #endif