This source file includes following definitions.
- ForwardingAgentHost
- ConnectionClosed
- ForwardingAgentHost
- Attach
- Detach
- DispatchOnInspectorBackend
- Create
- GetAgentHost
- DispatchOnClientHost
- ConnectionClosed
#include "content/browser/devtools/devtools_external_agent_proxy_impl.h"
#include "content/browser/devtools/devtools_agent_host_impl.h"
#include "content/browser/devtools/devtools_manager_impl.h"
#include "content/public/browser/devtools_external_agent_proxy_delegate.h"
namespace content {
class DevToolsExternalAgentProxyImpl::ForwardingAgentHost
: public DevToolsAgentHostImpl {
public:
ForwardingAgentHost(DevToolsExternalAgentProxyDelegate* delegate)
: delegate_(delegate) {
}
void ConnectionClosed() {
NotifyCloseListener();
}
private:
virtual ~ForwardingAgentHost() {
}
virtual void Attach() OVERRIDE {
delegate_->Attach();
};
virtual void Detach() OVERRIDE {
delegate_->Detach();
};
virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE {
delegate_->SendMessageToBackend(message);
}
DevToolsExternalAgentProxyDelegate* delegate_;
};
DevToolsExternalAgentProxy* DevToolsExternalAgentProxy::Create(
DevToolsExternalAgentProxyDelegate* delegate) {
return new DevToolsExternalAgentProxyImpl(delegate);
}
DevToolsExternalAgentProxyImpl::DevToolsExternalAgentProxyImpl(
DevToolsExternalAgentProxyDelegate* delegate)
: agent_host_(new ForwardingAgentHost(delegate)) {
}
DevToolsExternalAgentProxyImpl::~DevToolsExternalAgentProxyImpl() {
}
scoped_refptr<DevToolsAgentHost> DevToolsExternalAgentProxyImpl::
GetAgentHost() {
return agent_host_;
}
void DevToolsExternalAgentProxyImpl::DispatchOnClientHost(
const std::string& message) {
DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend(
agent_host_.get(), message);
}
void DevToolsExternalAgentProxyImpl::ConnectionClosed() {
agent_host_->ConnectionClosed();
}
}