| OLD | NEW |
| 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/client_session.h" | 5 #include "remoting/host/client_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 is_authenticated_ = true; | 290 is_authenticated_ = true; |
| 291 | 291 |
| 292 if (max_duration_ > base::TimeDelta()) { | 292 if (max_duration_ > base::TimeDelta()) { |
| 293 max_duration_timer_.Start( | 293 max_duration_timer_.Start( |
| 294 FROM_HERE, max_duration_, | 294 FROM_HERE, max_duration_, |
| 295 base::Bind(&ClientSession::DisconnectSession, base::Unretained(this), | 295 base::Bind(&ClientSession::DisconnectSession, base::Unretained(this), |
| 296 protocol::MAX_SESSION_LENGTH)); | 296 protocol::MAX_SESSION_LENGTH)); |
| 297 } | 297 } |
| 298 | 298 |
| 299 // Disconnect the session if the connection was rejected by the host. | 299 // Notify EventHandler. |
| 300 if (!event_handler_->OnSessionAuthenticated(this)) { | 300 event_handler_->OnSessionAuthenticated(this); |
| 301 DisconnectSession(protocol::SESSION_REJECTED); | |
| 302 return; | |
| 303 } | |
| 304 | 301 |
| 305 // Create the desktop environment. Drop the connection if it could not be | 302 // Create the desktop environment. Drop the connection if it could not be |
| 306 // created for any reason (for instance the curtain could not initialize). | 303 // created for any reason (for instance the curtain could not initialize). |
| 307 desktop_environment_ = | 304 desktop_environment_ = |
| 308 desktop_environment_factory_->Create(weak_factory_.GetWeakPtr()); | 305 desktop_environment_factory_->Create(weak_factory_.GetWeakPtr()); |
| 309 if (!desktop_environment_) { | 306 if (!desktop_environment_) { |
| 310 DisconnectSession(protocol::HOST_CONFIGURATION_ERROR); | 307 DisconnectSession(protocol::HOST_CONFIGURATION_ERROR); |
| 311 return; | 308 return; |
| 312 } | 309 } |
| 313 | 310 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 507 |
| 511 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 508 scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
| 512 DCHECK(CalledOnValidThread()); | 509 DCHECK(CalledOnValidThread()); |
| 513 | 510 |
| 514 return make_scoped_ptr( | 511 return make_scoped_ptr( |
| 515 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), | 512 new protocol::ClipboardThreadProxy(client_clipboard_factory_.GetWeakPtr(), |
| 516 base::ThreadTaskRunnerHandle::Get())); | 513 base::ThreadTaskRunnerHandle::Get())); |
| 517 } | 514 } |
| 518 | 515 |
| 519 } // namespace remoting | 516 } // namespace remoting |
| OLD | NEW |