[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | e4ac5df | 2009-03-17 15:33:11 | [diff] [blame] | 5 | #ifndef CHROME_RENDERER_DEVTOOLS_CLIENT_H_ |
6 | #define CHROME_RENDERER_DEVTOOLS_CLIENT_H_ | ||||
[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 7 | |
[email protected] | 611cad4 | 2009-03-16 18:51:34 | [diff] [blame] | 8 | #include <string> |
9 | |||||
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 10 | #include "base/basictypes.h" |
[email protected] | 611cad4 | 2009-03-16 18:51:34 | [diff] [blame] | 11 | #include "base/scoped_ptr.h" |
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 12 | #include "webkit/api/public/WebDevToolsFrontendClient.h" |
[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 13 | |
14 | namespace IPC { | ||||
15 | class Message; | ||||
16 | } | ||||
17 | class MessageLoop; | ||||
18 | class RenderView; | ||||
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 19 | |
20 | namespace WebKit { | ||||
21 | class WebDevToolsFrontend; | ||||
22 | } | ||||
[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 23 | |
24 | // Developer tools UI end of communication channel between the render process of | ||||
25 | // the page being inspected and tools UI renderer process. All messages will | ||||
26 | // go through browser process. On the side of the inspected page there's | ||||
27 | // corresponding DevToolsAgent object. | ||||
28 | // TODO(yurys): now the client is almost empty later it will delegate calls to | ||||
29 | // code in glue | ||||
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 30 | class DevToolsClient : public WebKit::WebDevToolsFrontendClient { |
[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 31 | public: |
32 | explicit DevToolsClient(RenderView* view); | ||||
33 | virtual ~DevToolsClient(); | ||||
34 | |||||
35 | // Called to possibly handle the incoming IPC message. Returns true if | ||||
36 | // handled. Called in render thread. | ||||
37 | bool OnMessageReceived(const IPC::Message& message); | ||||
38 | |||||
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 39 | // WebDevToolsFrontendClient implementation |
40 | virtual void sendMessageToAgent(const WebKit::WebString& class_name, | ||||
[email protected] | 4f4dc2f3 | 2009-10-16 16:00:32 | [diff] [blame] | 41 | const WebKit::WebString& method_name, |
42 | const WebKit::WebString& param1, | ||||
43 | const WebKit::WebString& param2, | ||||
44 | const WebKit::WebString& param3); | ||||
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 45 | virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command); |
[email protected] | 10fb687 | 2009-07-01 07:50:04 | [diff] [blame] | 46 | |
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 47 | virtual void activateWindow(); |
48 | virtual void closeWindow(); | ||||
49 | virtual void dockWindow(); | ||||
50 | virtual void undockWindow(); | ||||
[email protected] | 611cad4 | 2009-03-16 18:51:34 | [diff] [blame] | 51 | |
[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 52 | private: |
[email protected] | 37f39f0 | 2009-05-29 08:37:06 | [diff] [blame] | 53 | void OnRpcMessage(const std::string& class_name, |
54 | const std::string& method_name, | ||||
[email protected] | 7cb43d5 | 2009-08-27 17:47:18 | [diff] [blame] | 55 | const std::string& param1, |
56 | const std::string& param2, | ||||
57 | const std::string& param3); | ||||
[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 58 | |
59 | // Sends message to DevToolsAgent. | ||||
60 | void Send(const IPC::Message& tools_agent_message); | ||||
61 | |||||
62 | RenderView* render_view_; // host render view | ||||
[email protected] | 100f1a19 | 2009-10-28 09:11:57 | [diff] [blame] | 63 | scoped_ptr<WebKit::WebDevToolsFrontend> web_tools_frontend_; |
[email protected] | b2abac7 | 2009-02-26 12:39:28 | [diff] [blame] | 64 | |
65 | DISALLOW_COPY_AND_ASSIGN(DevToolsClient); | ||||
66 | }; | ||||
67 | |||||
[email protected] | e4ac5df | 2009-03-17 15:33:11 | [diff] [blame] | 68 | #endif // CHROME_RENDERER_DEVTOOLS_CLIENT_H_ |