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