OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "remoting/protocol/connection_to_client.h" | 5 #include "remoting/protocol/connection_to_client.h" |
6 | 6 |
7 #include "google/protobuf/message.h" | 7 #include "google/protobuf/message.h" |
8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
9 #include "remoting/protocol/client_control_sender.h" | 9 #include "remoting/protocol/client_control_sender.h" |
10 #include "remoting/protocol/host_message_dispatcher.h" | 10 #include "remoting/protocol/host_message_dispatcher.h" |
11 #include "remoting/protocol/host_stub.h" | 11 #include "remoting/protocol/host_stub.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 VideoStub* ConnectionToClient::video_stub() { | 70 VideoStub* ConnectionToClient::video_stub() { |
71 return video_writer_.get(); | 71 return video_writer_.get(); |
72 } | 72 } |
73 | 73 |
74 // Return pointer to ClientStub. | 74 // Return pointer to ClientStub. |
75 ClientStub* ConnectionToClient::client_stub() { | 75 ClientStub* ConnectionToClient::client_stub() { |
76 return client_stub_.get(); | 76 return client_stub_.get(); |
77 } | 77 } |
78 | 78 |
| 79 protocol::HostStub* ConnectionToClient::host_stub() { |
| 80 return host_stub_; |
| 81 } |
| 82 |
| 83 void ConnectionToClient::set_host_stub(protocol::HostStub* host_stub) { |
| 84 host_stub_ = host_stub; |
| 85 } |
| 86 |
79 void ConnectionToClient::OnSessionStateChange(protocol::Session::State state) { | 87 void ConnectionToClient::OnSessionStateChange(protocol::Session::State state) { |
80 if (state == protocol::Session::CONNECTED) { | 88 if (state == protocol::Session::CONNECTED) { |
81 client_stub_.reset(new ClientControlSender(session_->control_channel())); | 89 client_stub_.reset(new ClientControlSender(session_->control_channel())); |
82 video_writer_.reset(VideoWriter::Create(session_->config())); | 90 video_writer_.reset(VideoWriter::Create(session_->config())); |
83 video_writer_->Init(session_); | 91 video_writer_->Init(session_); |
84 | 92 |
85 dispatcher_.reset(new HostMessageDispatcher()); | 93 dispatcher_.reset(new HostMessageDispatcher()); |
86 dispatcher_->Initialize(session_.get(), host_stub_, input_stub_); | 94 dispatcher_->Initialize(session_.get(), host_stub_, input_stub_); |
87 } | 95 } |
88 | 96 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 146 |
139 // Enable/disable each of the channels. | 147 // Enable/disable each of the channels. |
140 if (input_stub_) | 148 if (input_stub_) |
141 input_stub_->OnAuthenticated(); | 149 input_stub_->OnAuthenticated(); |
142 if (host_stub_) | 150 if (host_stub_) |
143 host_stub_->OnAuthenticated(); | 151 host_stub_->OnAuthenticated(); |
144 if (client_stub_.get()) | 152 if (client_stub_.get()) |
145 client_stub_->OnAuthenticated(); | 153 client_stub_->OnAuthenticated(); |
146 } | 154 } |
147 | 155 |
| 156 bool ConnectionToClient::client_authenticated() { |
| 157 return client_authenticated_; |
| 158 } |
| 159 |
148 } // namespace protocol | 160 } // namespace protocol |
149 } // namespace remoting | 161 } // namespace remoting |
OLD | NEW |