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