| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 class CONTENT_EXPORT RenderViewDevToolsAgentHost | 34 class CONTENT_EXPORT RenderViewDevToolsAgentHost |
| 35 : public IPCDevToolsAgentHost, | 35 : public IPCDevToolsAgentHost, |
| 36 private WebContentsObserver, | 36 private WebContentsObserver, |
| 37 public NotificationObserver { | 37 public NotificationObserver { |
| 38 public: | 38 public: |
| 39 static void OnCancelPendingNavigation(RenderViewHost* pending, | 39 static void OnCancelPendingNavigation(RenderViewHost* pending, |
| 40 RenderViewHost* current); | 40 RenderViewHost* current); |
| 41 | 41 |
| 42 static bool DispatchIPCMessage(RenderViewHost* source, | |
| 43 const IPC::Message& message); | |
| 44 | |
| 45 RenderViewDevToolsAgentHost(RenderViewHost*); | 42 RenderViewDevToolsAgentHost(RenderViewHost*); |
| 46 | 43 |
| 47 RenderViewHost* render_view_host() { return render_view_host_; } | |
| 48 | |
| 49 void SynchronousSwapCompositorFrame( | 44 void SynchronousSwapCompositorFrame( |
| 50 const cc::CompositorFrameMetadata& frame_metadata); | 45 const cc::CompositorFrameMetadata& frame_metadata); |
| 51 | 46 |
| 47 // DevTooolsAgentHost overrides. |
| 48 virtual void DisconnectWebContents() OVERRIDE; |
| 49 virtual void ConnectWebContents(WebContents* web_contents) OVERRIDE; |
| 50 virtual WebContents* GetWebContents() OVERRIDE; |
| 51 |
| 52 private: | 52 private: |
| 53 friend class DevToolsAgentHost; | 53 friend class DevToolsAgentHost; |
| 54 | |
| 55 virtual ~RenderViewDevToolsAgentHost(); | 54 virtual ~RenderViewDevToolsAgentHost(); |
| 56 | 55 |
| 57 // DevTooolsAgentHost overrides. | |
| 58 virtual void DisconnectRenderViewHost() OVERRIDE; | |
| 59 virtual void ConnectRenderViewHost(RenderViewHost* rvh) OVERRIDE; | |
| 60 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; | |
| 61 | |
| 62 // IPCDevToolsAgentHost overrides. | 56 // IPCDevToolsAgentHost overrides. |
| 63 virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE; | 57 virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE; |
| 64 virtual void SendMessageToAgent(IPC::Message* msg) OVERRIDE; | 58 virtual void SendMessageToAgent(IPC::Message* msg) OVERRIDE; |
| 65 virtual void OnClientAttached() OVERRIDE; | 59 virtual void OnClientAttached() OVERRIDE; |
| 66 virtual void OnClientDetached() OVERRIDE; | 60 virtual void OnClientDetached() OVERRIDE; |
| 67 | 61 |
| 68 // WebContentsObserver overrides. | 62 // WebContentsObserver overrides. |
| 69 virtual void AboutToNavigateRenderView(RenderViewHost* dest_rvh) OVERRIDE; | 63 virtual void AboutToNavigateRenderView(RenderViewHost* dest_rvh) OVERRIDE; |
| 70 virtual void RenderViewHostChanged(RenderViewHost* old_host, | 64 virtual void RenderViewHostChanged(RenderViewHost* old_host, |
| 71 RenderViewHost* new_host) OVERRIDE; | 65 RenderViewHost* new_host) OVERRIDE; |
| 72 virtual void RenderViewDeleted(RenderViewHost* rvh) OVERRIDE; | 66 virtual void RenderViewDeleted(RenderViewHost* rvh) OVERRIDE; |
| 73 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 67 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
| 68 virtual bool OnMessageReceived(const IPC::Message& message, |
| 69 RenderFrameHost* render_frame_host) OVERRIDE; |
| 70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 74 virtual void DidAttachInterstitialPage() OVERRIDE; | 71 virtual void DidAttachInterstitialPage() OVERRIDE; |
| 75 | 72 |
| 76 // NotificationObserver overrides: | 73 // NotificationObserver overrides: |
| 77 virtual void Observe(int type, | 74 virtual void Observe(int type, |
| 78 const NotificationSource& source, | 75 const NotificationSource& source, |
| 79 const NotificationDetails& details) OVERRIDE; | 76 const NotificationDetails& details) OVERRIDE; |
| 80 | 77 |
| 78 void DisconnectRenderViewHost(); |
| 79 void ConnectRenderViewHost(RenderViewHost* rvh); |
| 81 void ReattachToRenderViewHost(RenderViewHost* rvh); | 80 void ReattachToRenderViewHost(RenderViewHost* rvh); |
| 82 | 81 |
| 83 bool DispatchIPCMessage(const IPC::Message& message); | 82 bool DispatchIPCMessage(const IPC::Message& message); |
| 84 | 83 |
| 85 void SetRenderViewHost(RenderViewHost* rvh); | 84 void SetRenderViewHost(RenderViewHost* rvh); |
| 86 void ClearRenderViewHost(); | 85 void ClearRenderViewHost(); |
| 87 | 86 |
| 88 void RenderViewCrashed(); | 87 void RenderViewCrashed(); |
| 89 void OnSwapCompositorFrame(const IPC::Message& message); | 88 void OnSwapCompositorFrame(const IPC::Message& message); |
| 90 bool OnSetTouchEventEmulationEnabled(const IPC::Message& message); | 89 bool OnSetTouchEventEmulationEnabled(const IPC::Message& message); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 107 std::string state_; | 106 std::string state_; |
| 108 NotificationRegistrar registrar_; | 107 NotificationRegistrar registrar_; |
| 109 bool reattaching_; | 108 bool reattaching_; |
| 110 | 109 |
| 111 DISALLOW_COPY_AND_ASSIGN(RenderViewDevToolsAgentHost); | 110 DISALLOW_COPY_AND_ASSIGN(RenderViewDevToolsAgentHost); |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 } // namespace content | 113 } // namespace content |
| 115 | 114 |
| 116 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ | 115 #endif // CONTENT_BROWSER_DEVTOOLS_RENDER_VIEW_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |