Implement SSLKEYLOGFILE for OpenSSL.
[chromium-blink-merge.git] / content / browser / devtools / render_view_devtools_agent_host.h
blob8657bfdc3e412f54efd1e5a53d0c4a15af50233d
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.
5 #ifndef CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_
6 #define CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_
8 #include <map>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "content/browser/devtools/ipc_devtools_agent_host.h"
14 #include "content/common/content_export.h"
15 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h"
17 #include "content/public/browser/web_contents_observer.h"
19 namespace cc {
20 class CompositorFrameMetadata;
23 namespace content {
25 class DevToolsPowerHandler;
26 class DevToolsTracingHandler;
27 class RendererOverridesHandler;
28 class RenderViewHost;
29 class RenderViewHostImpl;
31 #if defined(OS_ANDROID)
32 class PowerSaveBlockerImpl;
33 #endif
35 class CONTENT_EXPORT RenderViewDevToolsAgentHost
36 : public IPCDevToolsAgentHost,
37 private WebContentsObserver,
38 public NotificationObserver {
39 public:
40 static void OnCancelPendingNavigation(RenderViewHost* pending,
41 RenderViewHost* current);
43 RenderViewDevToolsAgentHost(RenderViewHost*);
45 void SynchronousSwapCompositorFrame(
46 const cc::CompositorFrameMetadata& frame_metadata);
48 // DevTooolsAgentHost overrides.
49 virtual void DisconnectWebContents() OVERRIDE;
50 virtual void ConnectWebContents(WebContents* web_contents) OVERRIDE;
51 virtual WebContents* GetWebContents() OVERRIDE;
52 virtual Type GetType() OVERRIDE;
53 virtual std::string GetTitle() OVERRIDE;
54 virtual GURL GetURL() OVERRIDE;
55 virtual bool Activate() OVERRIDE;
56 virtual bool Close() OVERRIDE;
58 private:
59 friend class DevToolsAgentHost;
60 virtual ~RenderViewDevToolsAgentHost();
62 // IPCDevToolsAgentHost overrides.
63 virtual void DispatchProtocolMessage(const std::string& message) OVERRIDE;
64 virtual void SendMessageToAgent(IPC::Message* msg) OVERRIDE;
65 virtual void OnClientAttached() OVERRIDE;
66 virtual void OnClientDetached() OVERRIDE;
68 // WebContentsObserver overrides.
69 virtual void AboutToNavigateRenderView(RenderViewHost* dest_rvh) OVERRIDE;
70 virtual void RenderViewHostChanged(RenderViewHost* old_host,
71 RenderViewHost* new_host) OVERRIDE;
72 virtual void RenderViewDeleted(RenderViewHost* rvh) OVERRIDE;
73 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
74 virtual bool OnMessageReceived(const IPC::Message& message,
75 RenderFrameHost* render_frame_host) OVERRIDE;
76 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
77 virtual void DidAttachInterstitialPage() OVERRIDE;
78 virtual void DidDetachInterstitialPage() OVERRIDE;
80 // NotificationObserver overrides:
81 virtual void Observe(int type,
82 const NotificationSource& source,
83 const NotificationDetails& details) OVERRIDE;
85 void DisconnectRenderViewHost();
86 void ConnectRenderViewHost(RenderViewHost* rvh);
87 void ReattachToRenderViewHost(RenderViewHost* rvh);
89 bool DispatchIPCMessage(const IPC::Message& message);
91 void SetRenderViewHost(RenderViewHost* rvh);
92 void ClearRenderViewHost();
94 void RenderViewCrashed();
95 void OnSwapCompositorFrame(const IPC::Message& message);
96 bool OnSetTouchEventEmulationEnabled(const IPC::Message& message);
98 void OnDispatchOnInspectorFrontend(const std::string& message);
99 void OnSaveAgentRuntimeState(const std::string& state);
100 void OnEnableTracing(const std::string& category_filter);
101 void OnDisableTracing();
103 void ClientDetachedFromRenderer();
105 void InnerOnClientAttached();
106 void InnerClientDetachedFromRenderer();
108 RenderViewHostImpl* render_view_host_;
109 scoped_ptr<RendererOverridesHandler> overrides_handler_;
110 scoped_ptr<DevToolsTracingHandler> tracing_handler_;
111 scoped_ptr<DevToolsPowerHandler> power_handler_;
112 #if defined(OS_ANDROID)
113 scoped_ptr<PowerSaveBlockerImpl> power_save_blocker_;
114 #endif
115 std::string state_;
116 NotificationRegistrar registrar_;
117 bool reattaching_;
119 DISALLOW_COPY_AND_ASSIGN(RenderViewDevToolsAgentHost);
122 } // namespace content
124 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_