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

Side by Side Diff: remoting/host/chromoting_host.cc

Issue 11886051: Turned UiStrings into a singleton so that the continue window does not depend on ChromotingHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback Created 7 years, 11 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
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/host/chromoting_host.h" 5 #include "remoting/host/chromoting_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 return; 366 return;
367 } 367 }
368 368
369 while (!clients_.empty()) { 369 while (!clients_.empty()) {
370 size_t size = clients_.size(); 370 size_t size = clients_.size();
371 clients_.front()->Disconnect(); 371 clients_.front()->Disconnect();
372 CHECK_EQ(clients_.size(), size - 1); 372 CHECK_EQ(clients_.size(), size - 1);
373 } 373 }
374 } 374 }
375 375
376 void ChromotingHost::SetUiStrings(const UiStrings& ui_strings) {
377 DCHECK(network_task_runner_->BelongsToCurrentThread());
378 DCHECK_EQ(state_, kInitial);
379
380 ui_strings_ = ui_strings;
381 }
382
383 void ChromotingHost::OnClientStopped() { 376 void ChromotingHost::OnClientStopped() {
384 DCHECK(network_task_runner_->BelongsToCurrentThread()); 377 DCHECK(network_task_runner_->BelongsToCurrentThread());
385 378
386 --clients_count_; 379 --clients_count_;
387 if (state_ == kStopping && !clients_count_) 380 if (state_ == kStopping && !clients_count_)
388 ShutdownFinish(); 381 ShutdownFinish();
389 } 382 }
390 383
391 void ChromotingHost::ShutdownFinish() { 384 void ChromotingHost::ShutdownFinish() {
392 DCHECK(network_task_runner_->BelongsToCurrentThread()); 385 DCHECK(network_task_runner_->BelongsToCurrentThread());
(...skipping 18 matching lines...) Expand all
411 OnShutdown()); 404 OnShutdown());
412 405
413 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); 406 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin();
414 it != shutdown_tasks_.end(); ++it) { 407 it != shutdown_tasks_.end(); ++it) {
415 it->Run(); 408 it->Run();
416 } 409 }
417 shutdown_tasks_.clear(); 410 shutdown_tasks_.clear();
418 } 411 }
419 412
420 } // namespace remoting 413 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698