| OLD | NEW |
| 1 // Copyright (c) 2011 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/client/chromoting_client.h" | 5 #include "remoting/client/chromoting_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "remoting/client/chromoting_view.h" | 8 #include "remoting/client/chromoting_view.h" |
| 9 #include "remoting/client/client_context.h" | 9 #include "remoting/client/client_context.h" |
| 10 #include "remoting/client/input_handler.h" | 10 #include "remoting/client/input_handler.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 rectangle_decoder_->DecodePacket( | 155 rectangle_decoder_->DecodePacket( |
| 156 packet, base::Bind(&ChromotingClient::OnPacketDone, | 156 packet, base::Bind(&ChromotingClient::OnPacketDone, |
| 157 base::Unretained(this), last_packet, decode_start)); | 157 base::Unretained(this), last_packet, decode_start)); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void ChromotingClient::OnConnectionState( | 160 void ChromotingClient::OnConnectionState( |
| 161 protocol::ConnectionToHost::State state, | 161 protocol::ConnectionToHost::State state, |
| 162 protocol::ConnectionToHost::Error error) { | 162 protocol::ConnectionToHost::Error error) { |
| 163 DCHECK(message_loop()->BelongsToCurrentThread()); | 163 DCHECK(message_loop()->BelongsToCurrentThread()); |
| 164 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")"; | 164 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")"; |
| 165 if (state == protocol::ConnectionToHost::CONNECTED || | 165 if (state == protocol::ConnectionToHost::CONNECTED) |
| 166 state == protocol::ConnectionToHost::AUTHENTICATED) | |
| 167 Initialize(); | 166 Initialize(); |
| 168 view_->SetConnectionState(state, error); | 167 view_->SetConnectionState(state, error); |
| 169 } | 168 } |
| 170 | 169 |
| 171 base::MessageLoopProxy* ChromotingClient::message_loop() { | 170 base::MessageLoopProxy* ChromotingClient::message_loop() { |
| 172 return context_->network_message_loop(); | 171 return context_->network_message_loop(); |
| 173 } | 172 } |
| 174 | 173 |
| 175 void ChromotingClient::OnPacketDone(bool last_packet, | 174 void ChromotingClient::OnPacketDone(bool last_packet, |
| 176 base::Time decode_start) { | 175 base::Time decode_start) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 205 } | 204 } |
| 206 | 205 |
| 207 // Initialize the decoder. | 206 // Initialize the decoder. |
| 208 rectangle_decoder_->Initialize(connection_->config()); | 207 rectangle_decoder_->Initialize(connection_->config()); |
| 209 | 208 |
| 210 // Schedule the input handler to process the event queue. | 209 // Schedule the input handler to process the event queue. |
| 211 input_handler_->Initialize(); | 210 input_handler_->Initialize(); |
| 212 } | 211 } |
| 213 | 212 |
| 214 } // namespace remoting | 213 } // namespace remoting |
| OLD | NEW |