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

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

Issue 13461029: The continue window is owned by the desktop environment now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 323
324 void ChromotingHost::set_protocol_config( 324 void ChromotingHost::set_protocol_config(
325 scoped_ptr<protocol::CandidateSessionConfig> config) { 325 scoped_ptr<protocol::CandidateSessionConfig> config) {
326 DCHECK(network_task_runner_->BelongsToCurrentThread()); 326 DCHECK(network_task_runner_->BelongsToCurrentThread());
327 DCHECK(config.get()); 327 DCHECK(config.get());
328 DCHECK_EQ(state_, kInitial); 328 DCHECK_EQ(state_, kInitial);
329 protocol_config_ = config.Pass(); 329 protocol_config_ = config.Pass();
330 } 330 }
331 331
332 void ChromotingHost::PauseSession(bool pause) {
333 if (!network_task_runner_->BelongsToCurrentThread()) {
334 network_task_runner_->PostTask(
335 FROM_HERE, base::Bind(&ChromotingHost::PauseSession, this, pause));
336 return;
337 }
338
339 ClientList::iterator client;
340 for (client = clients_.begin(); client != clients_.end(); ++client) {
341 (*client)->SetDisableInputs(pause);
342 }
343 }
344
345 void ChromotingHost::DisconnectAllClients() { 332 void ChromotingHost::DisconnectAllClients() {
346 if (!network_task_runner_->BelongsToCurrentThread()) { 333 if (!network_task_runner_->BelongsToCurrentThread()) {
347 network_task_runner_->PostTask( 334 network_task_runner_->PostTask(
348 FROM_HERE, base::Bind(&ChromotingHost::DisconnectAllClients, this)); 335 FROM_HERE, base::Bind(&ChromotingHost::DisconnectAllClients, this));
349 return; 336 return;
350 } 337 }
351 338
352 while (!clients_.empty()) { 339 while (!clients_.empty()) {
353 size_t size = clients_.size(); 340 size_t size = clients_.size();
354 clients_.front()->DisconnectSession(); 341 clients_.front()->DisconnectSession();
(...skipping 26 matching lines...) Expand all
381 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); 368 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin();
382 it != shutdown_tasks_.end(); ++it) { 369 it != shutdown_tasks_.end(); ++it) {
383 it->Run(); 370 it->Run();
384 } 371 }
385 shutdown_tasks_.clear(); 372 shutdown_tasks_.clear();
386 373
387 weak_factory_.InvalidateWeakPtrs(); 374 weak_factory_.InvalidateWeakPtrs();
388 } 375 }
389 376
390 } // namespace remoting 377 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698