Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Side by Side Diff: remoting/client/chromoting_client.cc

Issue 10692179: Propagate connection state from networking layer to UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/client/chromoting_client.h ('k') | remoting/client/client_user_interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/audio_player.h" 8 #include "remoting/client/audio_player.h"
9 #include "remoting/client/client_context.h" 9 #include "remoting/client/client_context.h"
10 #include "remoting/client/client_user_interface.h" 10 #include "remoting/client/client_user_interface.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 void ChromotingClient::OnConnectionState( 177 void ChromotingClient::OnConnectionState(
178 protocol::ConnectionToHost::State state, 178 protocol::ConnectionToHost::State state,
179 protocol::ErrorCode error) { 179 protocol::ErrorCode error) {
180 DCHECK(task_runner_->BelongsToCurrentThread()); 180 DCHECK(task_runner_->BelongsToCurrentThread());
181 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")"; 181 VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")";
182 if (state == protocol::ConnectionToHost::CONNECTED) 182 if (state == protocol::ConnectionToHost::CONNECTED)
183 Initialize(); 183 Initialize();
184 user_interface_->OnConnectionState(state, error); 184 user_interface_->OnConnectionState(state, error);
185 } 185 }
186 186
187 void ChromotingClient::OnConnectionReady(bool ready) {
188 VLOG(1) << "ChromotingClient::OnConnectionReady(" << ready << ")";
189 user_interface_->OnConnectionReady(ready);
190 }
191
187 void ChromotingClient::OnPacketDone(bool last_packet, 192 void ChromotingClient::OnPacketDone(bool last_packet,
188 base::Time decode_start) { 193 base::Time decode_start) {
189 if (!task_runner_->BelongsToCurrentThread()) { 194 if (!task_runner_->BelongsToCurrentThread()) {
190 task_runner_->PostTask(FROM_HERE, base::Bind( 195 task_runner_->PostTask(FROM_HERE, base::Bind(
191 &ChromotingClient::OnPacketDone, base::Unretained(this), 196 &ChromotingClient::OnPacketDone, base::Unretained(this),
192 last_packet, decode_start)); 197 last_packet, decode_start));
193 return; 198 return;
194 } 199 }
195 200
196 // Record the latency between the final packet being received and 201 // Record the latency between the final packet being received and
(...skipping 13 matching lines...) Expand all
210 } 215 }
211 216
212 void ChromotingClient::Initialize() { 217 void ChromotingClient::Initialize() {
213 DCHECK(task_runner_->BelongsToCurrentThread()); 218 DCHECK(task_runner_->BelongsToCurrentThread());
214 219
215 // Initialize the decoder. 220 // Initialize the decoder.
216 rectangle_decoder_->Initialize(connection_->config()); 221 rectangle_decoder_->Initialize(connection_->config());
217 } 222 }
218 223
219 } // namespace remoting 224 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/chromoting_client.h ('k') | remoting/client/client_user_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698