forwarding_agent_host.cc revision cedac228d2dd51db4b79ea1e72c7f249408ee061
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  DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend(
21      this, message);
22}
23
24void ForwardingAgentHost::ConnectionClosed() {
25  NotifyCloseListener();
26}
27
28void ForwardingAgentHost::Attach() {
29  delegate_->Attach(this);
30}
31
32void ForwardingAgentHost::Detach() {
33  delegate_->Detach();
34}
35
36void ForwardingAgentHost::DispatchOnInspectorBackend(
37    const std::string& message) {
38  delegate_->SendMessageToBackend(message);
39}
40
41}  // content
42