| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "media/base/callback.h" | 9 #include "media/base/callback.h" |
| 10 #include "remoting/host/user_authenticator.h" | 10 #include "remoting/host/user_authenticator.h" |
| 11 #include "remoting/proto/auth.pb.h" | 11 #include "remoting/proto/auth.pb.h" |
| 12 | 12 |
| 13 namespace remoting { | 13 namespace remoting { |
| 14 | 14 |
| 15 ClientSession::ClientSession( | 15 ClientSession::ClientSession( |
| 16 EventHandler* event_handler, | 16 EventHandler* event_handler, |
| 17 const base::Callback<UserAuthenticatorFactory>& auth_factory, | 17 const base::Callback<UserAuthenticatorFactory>& auth_factory, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 void ClientSession::BeginSessionRequest( | 41 void ClientSession::BeginSessionRequest( |
| 42 const protocol::LocalLoginCredentials* credentials, Task* done) { | 42 const protocol::LocalLoginCredentials* credentials, Task* done) { |
| 43 DCHECK(event_handler_); | 43 DCHECK(event_handler_); |
| 44 | 44 |
| 45 media::AutoTaskRunner done_runner(done); | 45 media::AutoTaskRunner done_runner(done); |
| 46 | 46 |
| 47 bool success = false; | 47 bool success = false; |
| 48 scoped_ptr<UserAuthenticator> authenticator(auth_factory_.Run()); | 48 scoped_refptr<UserAuthenticator> authenticator(auth_factory_.Run()); |
| 49 switch (credentials->type()) { | 49 switch (credentials->type()) { |
| 50 case protocol::PASSWORD: | 50 case protocol::PASSWORD: |
| 51 success = authenticator->Authenticate(credentials->username(), | 51 success = authenticator->Authenticate(credentials->username(), |
| 52 credentials->credential()); | 52 credentials->credential()); |
| 53 break; | 53 break; |
| 54 | 54 |
| 55 default: | 55 default: |
| 56 LOG(ERROR) << "Invalid credentials type " << credentials->type(); | 56 LOG(ERROR) << "Invalid credentials type " << credentials->type(); |
| 57 break; | 57 break; |
| 58 } | 58 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 83 input_stub_->InjectMouseEvent(event, done); | 83 input_stub_->InjectMouseEvent(event, done); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void ClientSession::Disconnect() { | 87 void ClientSession::Disconnect() { |
| 88 connection_->Disconnect(); | 88 connection_->Disconnect(); |
| 89 authenticated_ = false; | 89 authenticated_ = false; |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace remoting | 92 } // namespace remoting |
| OLD | NEW |