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_DEVTOOLS_AGENT_HOST_IMPL_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
10 #include "base/compiler_specific.h"
11 #include "content/common/content_export.h"
12 #include "content/public/browser/devtools_agent_host.h"
20 // Describes interface for managing devtools agents from the browser process.
21 class CONTENT_EXPORT DevToolsAgentHostImpl
: public DevToolsAgentHost
{
23 class CONTENT_EXPORT CloseListener
{
25 virtual void AgentHostClosing(DevToolsAgentHostImpl
*) = 0;
27 virtual ~CloseListener() {}
30 // Informs the hosted agent that a client host has attached.
31 virtual void Attach() = 0;
33 // Informs the hosted agent that a client host has detached.
34 virtual void Detach() = 0;
36 // Sends a message to the agent hosted by this object.
37 virtual void DispatchOnInspectorBackend(const std::string
& message
) = 0;
39 void set_close_listener(CloseListener
* listener
) {
40 close_listener_
= listener
;
43 // DevToolsAgentHost implementation.
44 virtual bool IsAttached() OVERRIDE
;
46 virtual void InspectElement(int x
, int y
) OVERRIDE
;
48 virtual std::string
GetId() OVERRIDE
;
50 virtual RenderViewHost
* GetRenderViewHost() OVERRIDE
;
52 virtual void DisconnectRenderViewHost() OVERRIDE
;
54 virtual void ConnectRenderViewHost(RenderViewHost
* rvh
) OVERRIDE
;
57 DevToolsAgentHostImpl();
58 virtual ~DevToolsAgentHostImpl();
60 void NotifyCloseListener();
63 CloseListener
* close_listener_
;
64 const std::string id_
;
67 } // namespace content
69 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_