OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "content/browser/devtools/devtools_agent_host_impl.h" | 13 #include "content/browser/devtools/devtools_agent_host_impl.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/render_view_host_observer.h" | 15 #include "content/public/browser/render_view_host_observer.h" |
16 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class DevToolsAgentHostRvhObserver; | 20 class DevToolsAgentHostRvhObserver; |
| 21 class NavigationEntry; |
21 class RendererOverridesHandler; | 22 class RendererOverridesHandler; |
22 class RenderViewHost; | 23 class RenderViewHost; |
23 | 24 |
24 class CONTENT_EXPORT RenderViewDevToolsAgentHost | 25 class CONTENT_EXPORT RenderViewDevToolsAgentHost |
25 : public DevToolsAgentHostImpl, | 26 : public DevToolsAgentHostImpl, |
26 private WebContentsObserver { | 27 private WebContentsObserver { |
27 public: | 28 public: |
28 static void OnCancelPendingNavigation(RenderViewHost* pending, | 29 static void OnCancelPendingNavigation(RenderViewHost* pending, |
29 RenderViewHost* current); | 30 RenderViewHost* current); |
30 | 31 |
31 RenderViewDevToolsAgentHost(RenderViewHost*); | 32 RenderViewDevToolsAgentHost(RenderViewHost*); |
32 | 33 |
33 RenderViewHost* render_view_host() { return render_view_host_; } | 34 RenderViewHost* render_view_host() { return render_view_host_; } |
34 | 35 |
35 private: | 36 private: |
36 friend class DevToolsAgentHost; | 37 friend class DevToolsAgentHost; |
37 friend class DevToolsAgentHostRvhObserver; | 38 friend class DevToolsAgentHostRvhObserver; |
38 | 39 |
39 virtual ~RenderViewDevToolsAgentHost(); | 40 virtual ~RenderViewDevToolsAgentHost(); |
40 | 41 |
41 // DevTooolsAgentHost overrides. | 42 // DevTooolsAgentHost overrides. |
42 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; | 43 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; |
43 | 44 |
| 45 virtual std::string title() OVERRIDE; |
| 46 |
| 47 virtual GURL url() OVERRIDE; |
| 48 |
| 49 virtual GURL thumbnail_url() OVERRIDE; |
| 50 |
| 51 virtual GURL favicon_url() OVERRIDE; |
| 52 |
44 // DevToolsAgentHostImpl overrides. | 53 // DevToolsAgentHostImpl overrides. |
45 virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE; | 54 virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE; |
46 virtual void SendMessageToAgent(IPC::Message* msg) OVERRIDE; | 55 virtual void SendMessageToAgent(IPC::Message* msg) OVERRIDE; |
47 virtual void NotifyClientAttaching() OVERRIDE; | 56 virtual void NotifyClientAttaching() OVERRIDE; |
48 virtual void NotifyClientDetaching() OVERRIDE; | 57 virtual void NotifyClientDetaching() OVERRIDE; |
49 | 58 |
50 // WebContentsObserver overrides. | 59 // WebContentsObserver overrides. |
51 virtual void AboutToNavigateRenderView(RenderViewHost* dest_rvh) OVERRIDE; | 60 virtual void AboutToNavigateRenderView(RenderViewHost* dest_rvh) OVERRIDE; |
52 | 61 |
53 void ConnectRenderViewHost(RenderViewHost* rvh, bool reattach); | 62 void ConnectRenderViewHost(RenderViewHost* rvh, bool reattach); |
54 void DisconnectRenderViewHost(); | 63 void DisconnectRenderViewHost(); |
55 | 64 |
56 void RenderViewHostDestroyed(RenderViewHost* rvh); | 65 void RenderViewHostDestroyed(RenderViewHost* rvh); |
57 bool OnRvhMessageReceived(const IPC::Message& message); | 66 bool OnRvhMessageReceived(const IPC::Message& message); |
58 | 67 |
59 void OnDispatchOnInspectorFrontend(const std::string& message); | 68 void OnDispatchOnInspectorFrontend(const std::string& message); |
60 void OnSaveAgentRuntimeState(const std::string& state); | 69 void OnSaveAgentRuntimeState(const std::string& state); |
61 void OnClearBrowserCache(); | 70 void OnClearBrowserCache(); |
62 void OnClearBrowserCookies(); | 71 void OnClearBrowserCookies(); |
63 | 72 |
64 bool CaptureScreenshot(std::string* base_64_data); | 73 bool CaptureScreenshot(std::string* base_64_data); |
65 | 74 |
| 75 NavigationEntry* GetNavigationEntry(); |
| 76 |
66 RenderViewHost* render_view_host_; | 77 RenderViewHost* render_view_host_; |
67 scoped_ptr<DevToolsAgentHostRvhObserver> rvh_observer_; | 78 scoped_ptr<DevToolsAgentHostRvhObserver> rvh_observer_; |
68 scoped_ptr<RendererOverridesHandler> overrides_handler_; | 79 scoped_ptr<RendererOverridesHandler> overrides_handler_; |
69 std::string state_; | 80 std::string state_; |
70 | 81 |
71 DISALLOW_COPY_AND_ASSIGN(RenderViewDevToolsAgentHost); | 82 DISALLOW_COPY_AND_ASSIGN(RenderViewDevToolsAgentHost); |
72 }; | 83 }; |
73 | 84 |
74 } // namespace content | 85 } // namespace content |
75 | 86 |
76 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ | 87 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ |
OLD | NEW |