OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/devtools/forwarding_agent_host.h" | 5 #include "content/browser/devtools/forwarding_agent_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/browser/devtools/protocol/inspector_handler.h" | 8 #include "content/browser/devtools/protocol/inspector_handler.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 ForwardingAgentHost::ForwardingAgentHost( | 12 ForwardingAgentHost::ForwardingAgentHost( |
13 DevToolsExternalAgentProxyDelegate* delegate) | 13 DevToolsExternalAgentProxyDelegate* delegate) |
14 : delegate_(delegate) { | 14 : DevToolsAgentHostImpl(delegate->GetId()), |
| 15 delegate_(delegate) { |
15 } | 16 } |
16 | 17 |
17 ForwardingAgentHost::~ForwardingAgentHost() { | 18 ForwardingAgentHost::~ForwardingAgentHost() { |
18 } | 19 } |
19 | 20 |
20 void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) { | 21 void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) { |
21 SendMessageToClient(session_id(), message); | 22 SendMessageToClient(session_id(), message); |
22 } | 23 } |
23 | 24 |
24 void ForwardingAgentHost::ConnectionClosed() { | 25 void ForwardingAgentHost::ConnectionClosed() { |
25 HostClosed(); | 26 HostClosed(); |
26 } | 27 } |
27 | 28 |
28 void ForwardingAgentHost::Attach() { | 29 void ForwardingAgentHost::Attach() { |
29 delegate_->Attach(this); | 30 delegate_->Attach(this); |
30 } | 31 } |
31 | 32 |
32 void ForwardingAgentHost::Detach() { | 33 void ForwardingAgentHost::Detach() { |
33 delegate_->Detach(); | 34 delegate_->Detach(); |
34 } | 35 } |
35 | 36 |
36 bool ForwardingAgentHost::DispatchProtocolMessage( | 37 bool ForwardingAgentHost::DispatchProtocolMessage( |
37 const std::string& message) { | 38 const std::string& message) { |
38 delegate_->SendMessageToBackend(message); | 39 delegate_->SendMessageToBackend(message); |
39 return true; | 40 return true; |
40 } | 41 } |
41 | 42 |
42 DevToolsAgentHost::Type ForwardingAgentHost::GetType() { | 43 std::string ForwardingAgentHost::GetType() { |
43 return TYPE_EXTERNAL; | 44 return delegate_->GetType(); |
44 } | 45 } |
45 | 46 |
46 std::string ForwardingAgentHost::GetTitle() { | 47 std::string ForwardingAgentHost::GetTitle() { |
47 return ""; | 48 return delegate_->GetTitle(); |
48 } | 49 } |
49 | 50 |
50 GURL ForwardingAgentHost::GetURL() { | 51 GURL ForwardingAgentHost::GetURL() { |
51 return GURL(); | 52 return delegate_->GetURL(); |
| 53 } |
| 54 |
| 55 GURL ForwardingAgentHost::GetFaviconURL() { |
| 56 return delegate_->GetFaviconURL(); |
52 } | 57 } |
53 | 58 |
54 bool ForwardingAgentHost::Activate() { | 59 bool ForwardingAgentHost::Activate() { |
55 return false; | 60 return delegate_->Activate(); |
| 61 } |
| 62 |
| 63 bool ForwardingAgentHost::Inspect() { |
| 64 return delegate_->Inspect(); |
| 65 } |
| 66 |
| 67 void ForwardingAgentHost::Reload() { |
| 68 delegate_->Reload(); |
56 } | 69 } |
57 | 70 |
58 bool ForwardingAgentHost::Close() { | 71 bool ForwardingAgentHost::Close() { |
59 return false; | 72 return delegate_->Close(); |
60 } | 73 } |
61 | 74 |
62 } // content | 75 } // content |
OLD | NEW |