1// Copyright 2014 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. 4 5#ifndef CONTENT_BROWSER_DEVTOOLS_FORWARDING_AGENT_HOST_H 6#define CONTENT_BROWSER_DEVTOOLS_FORWARDING_AGENT_HOST_H 7 8#include "base/memory/ref_counted.h" 9#include "base/memory/scoped_ptr.h" 10#include "content/browser/devtools/devtools_agent_host_impl.h" 11#include "content/public/browser/devtools_external_agent_proxy.h" 12#include "content/public/browser/devtools_external_agent_proxy_delegate.h" 13 14namespace content { 15 16class ForwardingAgentHost 17 : public DevToolsAgentHostImpl, 18 public DevToolsExternalAgentProxy { 19 public: 20 ForwardingAgentHost(DevToolsExternalAgentProxyDelegate* delegate); 21 22 private: 23 virtual ~ForwardingAgentHost(); 24 25 // DevToolsExternalAgentProxy implementation. 26 virtual void DispatchOnClientHost(const std::string& message) OVERRIDE; 27 virtual void ConnectionClosed() OVERRIDE; 28 29 // DevToolsAgentHostImpl implementation. 30 virtual void Attach() OVERRIDE; 31 virtual void Detach() OVERRIDE; 32 virtual void DispatchProtocolMessage(const std::string& message) OVERRIDE; 33 34 // DevToolsAgentHost implementation 35 virtual Type GetType() OVERRIDE; 36 virtual std::string GetTitle() OVERRIDE; 37 virtual GURL GetURL() OVERRIDE; 38 virtual bool Activate() OVERRIDE; 39 virtual bool Close() OVERRIDE; 40 41 scoped_ptr<DevToolsExternalAgentProxyDelegate> delegate_; 42}; 43 44} // namespace content 45 46#endif // CONTENT_BROWSER_DEVTOOLS_FORWARDING_AGENT_HOST_H 47