ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / browser / devtools / forwarding_agent_host.cc
blobdb8af96a2b1f5df3a82b20eaade3dea4aaca62d9
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.
5 #include "content/browser/devtools/forwarding_agent_host.h"
7 #include "base/bind.h"
8 #include "content/browser/devtools/protocol/inspector_handler.h"
10 namespace content {
12 ForwardingAgentHost::ForwardingAgentHost(
13 DevToolsExternalAgentProxyDelegate* delegate)
14 : delegate_(delegate) {
17 ForwardingAgentHost::~ForwardingAgentHost() {
20 void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) {
21 SendMessageToClient(message);
24 void ForwardingAgentHost::ConnectionClosed() {
25 devtools::inspector::Client inspector(
26 base::Bind(&ForwardingAgentHost::DispatchOnClientHost,
27 base::Unretained(this)));
28 inspector.Detached(devtools::inspector::DetachedParams::Create()
29 ->set_reason("Connection lost."));
30 delegate_.reset();
33 void ForwardingAgentHost::Attach() {
34 if (delegate_)
35 delegate_->Attach(this);
38 void ForwardingAgentHost::Detach() {
39 if (delegate_)
40 delegate_->Detach();
43 void ForwardingAgentHost::DispatchProtocolMessage(
44 const std::string& message) {
45 if (delegate_)
46 delegate_->SendMessageToBackend(message);
49 DevToolsAgentHost::Type ForwardingAgentHost::GetType() {
50 return TYPE_EXTERNAL;
53 std::string ForwardingAgentHost::GetTitle() {
54 return "";
57 GURL ForwardingAgentHost::GetURL() {
58 return GURL();
61 bool ForwardingAgentHost::Activate() {
62 return false;
65 bool ForwardingAgentHost::Close() {
66 return false;
69 } // content