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 #include "content/browser/devtools/forwarding_agent_host.h" 6 7 namespace content { 8 9 ForwardingAgentHost::ForwardingAgentHost( 10 DevToolsExternalAgentProxyDelegate* delegate) 11 : delegate_(delegate) { 12 } 13 14 ForwardingAgentHost::~ForwardingAgentHost() { 15 } 16 17 void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) { 18 SendMessageToClient(message); 19 } 20 21 void ForwardingAgentHost::ConnectionClosed() { 22 HostClosed(); 23 } 24 25 void ForwardingAgentHost::Attach() { 26 delegate_->Attach(this); 27 } 28 29 void ForwardingAgentHost::Detach() { 30 delegate_->Detach(); 31 } 32 33 void ForwardingAgentHost::DispatchProtocolMessage( 34 const std::string& message) { 35 delegate_->SendMessageToBackend(message); 36 } 37 38 DevToolsAgentHost::Type ForwardingAgentHost::GetType() { 39 return TYPE_EXTERNAL; 40 } 41 42 std::string ForwardingAgentHost::GetTitle() { 43 return ""; 44 } 45 46 GURL ForwardingAgentHost::GetURL() { 47 return GURL(); 48 } 49 50 bool ForwardingAgentHost::Activate() { 51 return false; 52 } 53 54 bool ForwardingAgentHost::Close() { 55 return false; 56 } 57 58 } // content 59