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