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_BROWSER_DEBUGGER_DEVTOOLS_FRONTEND_HOST_H_ | |
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_FRONTEND_HOST_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/compiler_specific.h" | |
12 #include "content/public/browser/devtools_client_host.h" | |
13 #include "content/public/browser/render_view_host_observer.h" | |
14 | |
15 namespace content { | |
16 | |
17 class DevToolsFrontendHostDelegate; | |
18 class WebContentsImpl; | |
19 | |
20 // This class handles messages from DevToolsClient and calls corresponding | |
21 // methods on DevToolsFrontendHostDelegate which is implemented by the | |
22 // embedder. This allows us to avoid exposing DevTools client messages through | |
23 // the content public API. | |
24 class DevToolsFrontendHost : public DevToolsClientHost, | |
25 public RenderViewHostObserver { | |
26 public: | |
27 DevToolsFrontendHost(WebContentsImpl* web_contents, | |
28 DevToolsFrontendHostDelegate* delegate); | |
29 | |
30 private: | |
31 virtual ~DevToolsFrontendHost(); | |
32 | |
33 // DevToolsClientHost implementation. | |
34 virtual void DispatchOnInspectorFrontend(const std::string& message) OVERRIDE; | |
35 virtual void InspectedContentsClosing() OVERRIDE; | |
36 virtual void FrameNavigating(const std::string& url) OVERRIDE; | |
37 virtual void ContentsReplaced(WebContents* new_contents) OVERRIDE; | |
38 virtual void ReplacedWithAnotherClient() OVERRIDE; | |
39 | |
40 // RenderViewHostObserver overrides. | |
41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
42 | |
43 void OnDispatchOnInspectorBackend(const std::string& message); | |
44 void OnActivateWindow(); | |
45 void OnCloseWindow(); | |
46 void OnMoveWindow(int x, int y); | |
47 void OnRequestSetDockSide(const std::string& side); | |
48 void OnOpenInNewTab(const std::string& url); | |
49 void OnSave(const std::string& url, const std::string& content, bool save_as); | |
50 void OnAppend(const std::string& url, const std::string& content); | |
51 | |
52 WebContentsImpl* web_contents_; | |
53 DevToolsFrontendHostDelegate* delegate_; | |
54 DISALLOW_COPY_AND_ASSIGN(DevToolsFrontendHost); | |
55 }; | |
56 | |
57 } // namespace content | |
58 | |
59 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_FRONTEND_HOST_H_ | |
OLD | NEW |