forwarding_agent_host.cc revision 03b57e008b61dfcb1fbad3aea950ae0e001748b0
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#include "content/browser/devtools/devtools_manager_impl.h"
8
9namespace content {
10
11ForwardingAgentHost::ForwardingAgentHost(
12    DevToolsExternalAgentProxyDelegate* delegate)
13      : delegate_(delegate) {
14}
15
16ForwardingAgentHost::~ForwardingAgentHost() {
17}
18
19void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) {
20  SendMessageToClient(message);
21}
22
23void ForwardingAgentHost::ConnectionClosed() {
24  HostClosed();
25}
26
27void ForwardingAgentHost::Attach() {
28  delegate_->Attach(this);
29}
30
31void ForwardingAgentHost::Detach() {
32  delegate_->Detach();
33}
34
35void ForwardingAgentHost::DispatchProtocolMessage(
36    const std::string& message) {
37  delegate_->SendMessageToBackend(message);
38}
39
40}  // content
41