OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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/devtools_remote_agent_connector_impl.h" | |
6 | |
7 #include "content/browser/devtools/devtools_agent_host_impl.h" | |
8 | |
9 namespace content { | |
10 | |
11 class ForwardingDevToolsAgentHost: public content::DevToolsAgentHostImpl { | |
pfeldman
2013/03/21 06:24:32
Space before : missing
Vladislav Kaznacheev
2013/03/21 06:55:53
Done.
| |
12 friend class DevToolsRemoteAgentConnectorImpl; | |
pfeldman
2013/03/21 06:24:32
Why friends?
Vladislav Kaznacheev
2013/03/21 06:55:53
Its constructor is private. But I have a better id
| |
13 | |
14 ForwardingDevToolsAgentHost( | |
15 content::DevToolsRemoteAgentConnector::Delegate* delegate) | |
16 : delegate_(delegate) { | |
17 } | |
18 | |
19 // DevToolsAgentHostImpl implementation. | |
20 virtual void Attach() OVERRIDE { | |
21 delegate_->Attach(); | |
22 }; | |
23 | |
24 virtual void Detach() OVERRIDE { | |
25 delegate_->Detach(); | |
26 }; | |
27 | |
28 virtual void DispatchOnInspectorBackend(const std::string& message) OVERRIDE { | |
29 delegate_->Send(message); | |
30 } | |
31 | |
32 void ConnectionClosed() { | |
33 NotifyCloseListener(); | |
34 } | |
35 | |
36 content::DevToolsRemoteAgentConnector::Delegate* delegate_; | |
37 }; | |
38 | |
39 //static | |
40 DevToolsRemoteAgentConnector* DevToolsRemoteAgentConnector:: | |
41 CreateFor(DevToolsRemoteAgentConnector::Delegate* delegate) { | |
42 return new DevToolsRemoteAgentConnectorImpl(delegate); | |
43 } | |
44 | |
45 DevToolsRemoteAgentConnectorImpl::DevToolsRemoteAgentConnectorImpl( | |
46 Delegate* delegate) | |
47 : agent_host_(new ForwardingDevToolsAgentHost(delegate)) { | |
48 } | |
49 | |
50 DevToolsAgentHost* DevToolsRemoteAgentConnectorImpl::GetAgentHost() { | |
51 return agent_host_; | |
52 } | |
53 | |
54 void DevToolsRemoteAgentConnectorImpl::ConnectionClosed() { | |
55 agent_host_->ConnectionClosed(); | |
56 } | |
57 | |
58 } // content | |
OLD | NEW |