OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 | |
5 #ifndef CONTENT_RENDERER_DEVTOOLS_CLIENT_H_ | |
6 #define CONTENT_RENDERER_DEVTOOLS_CLIENT_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "content/public/renderer/render_view_observer.h" | |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontendCl
ient.h" | |
14 | |
15 namespace WebKit { | |
16 class WebDevToolsFrontend; | |
17 class WebString; | |
18 } | |
19 | |
20 namespace content { | |
21 | |
22 class RenderViewImpl; | |
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 | |
30 class DevToolsClient : public RenderViewObserver, | |
31 public WebKit::WebDevToolsFrontendClient { | |
32 public: | |
33 explicit DevToolsClient(RenderViewImpl* render_view); | |
34 virtual ~DevToolsClient(); | |
35 | |
36 private: | |
37 // RenderView::Observer implementation. | |
38 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
39 | |
40 // WebDevToolsFrontendClient implementation. | |
41 virtual void sendMessageToBackend(const WebKit::WebString&) OVERRIDE; | |
42 | |
43 virtual void activateWindow() OVERRIDE; | |
44 virtual void closeWindow() OVERRIDE; | |
45 virtual void moveWindowBy(const WebKit::WebFloatPoint& offset) OVERRIDE; | |
46 virtual void requestSetDockSide(const WebKit::WebString& side) OVERRIDE; | |
47 virtual void openInNewTab(const WebKit::WebString& side) OVERRIDE; | |
48 virtual void save(const WebKit::WebString& url, | |
49 const WebKit::WebString& content, | |
50 bool save_as) OVERRIDE; | |
51 virtual void append(const WebKit::WebString& url, | |
52 const WebKit::WebString& content) OVERRIDE; | |
53 | |
54 void OnDispatchOnInspectorFrontend(const std::string& message); | |
55 | |
56 scoped_ptr<WebKit::WebDevToolsFrontend> web_tools_frontend_; | |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(DevToolsClient); | |
59 }; | |
60 | |
61 } // namespace content | |
62 | |
63 #endif // CONTENT_RENDERER_DEVTOOLS_CLIENT_H_ | |
OLD | NEW |