blob: a38025524caf1726cdf038691016ecc286004a0c [file] [log] [blame]
[email protected]b2abac72009-02-26 12:39:281// 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]e4ac5df2009-03-17 15:33:115#ifndef CHROME_RENDERER_DEVTOOLS_CLIENT_H_
6#define CHROME_RENDERER_DEVTOOLS_CLIENT_H_
[email protected]b2abac72009-02-26 12:39:287
[email protected]611cad42009-03-16 18:51:348#include <string>
9
[email protected]100f1a192009-10-28 09:11:5710#include "base/basictypes.h"
[email protected]611cad42009-03-16 18:51:3411#include "base/scoped_ptr.h"
[email protected]100f1a192009-10-28 09:11:5712#include "webkit/api/public/WebDevToolsFrontendClient.h"
[email protected]b2abac72009-02-26 12:39:2813
14namespace IPC {
15class Message;
16}
17class MessageLoop;
18class RenderView;
[email protected]100f1a192009-10-28 09:11:5719
20namespace WebKit {
21class WebDevToolsFrontend;
22}
[email protected]b2abac72009-02-26 12:39:2823
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]100f1a192009-10-28 09:11:5730class DevToolsClient : public WebKit::WebDevToolsFrontendClient {
[email protected]b2abac72009-02-26 12:39:2831 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]100f1a192009-10-28 09:11:5739 // WebDevToolsFrontendClient implementation
40 virtual void sendMessageToAgent(const WebKit::WebString& class_name,
[email protected]4f4dc2f32009-10-16 16:00:3241 const WebKit::WebString& method_name,
42 const WebKit::WebString& param1,
43 const WebKit::WebString& param2,
44 const WebKit::WebString& param3);
[email protected]100f1a192009-10-28 09:11:5745 virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command);
[email protected]10fb6872009-07-01 07:50:0446
[email protected]100f1a192009-10-28 09:11:5747 virtual void activateWindow();
48 virtual void closeWindow();
49 virtual void dockWindow();
50 virtual void undockWindow();
[email protected]611cad42009-03-16 18:51:3451
[email protected]b2abac72009-02-26 12:39:2852 private:
[email protected]37f39f02009-05-29 08:37:0653 void OnRpcMessage(const std::string& class_name,
54 const std::string& method_name,
[email protected]7cb43d52009-08-27 17:47:1855 const std::string& param1,
56 const std::string& param2,
57 const std::string& param3);
[email protected]b2abac72009-02-26 12:39:2858
59 // Sends message to DevToolsAgent.
60 void Send(const IPC::Message& tools_agent_message);
61
62 RenderView* render_view_; // host render view
[email protected]100f1a192009-10-28 09:11:5763 scoped_ptr<WebKit::WebDevToolsFrontend> web_tools_frontend_;
[email protected]b2abac72009-02-26 12:39:2864
65 DISALLOW_COPY_AND_ASSIGN(DevToolsClient);
66};
67
[email protected]e4ac5df2009-03-17 15:33:1168#endif // CHROME_RENDERER_DEVTOOLS_CLIENT_H_