| 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/desktop_environment.h" | 5 #include "remoting/host/desktop_environment.h" |
| 6 | 6 |
| 7 #include "remoting/host/capturer.h" | 7 #include "remoting/host/capturer.h" |
| 8 #include "remoting/host/chromoting_host.h" | 8 #include "remoting/host/chromoting_host.h" |
| 9 #include "remoting/host/user_authenticator.h" | 9 #include "remoting/host/user_authenticator.h" |
| 10 #include "remoting/proto/auth.pb.h" | 10 #include "remoting/proto/auth.pb.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 DesktopEnvironment::~DesktopEnvironment() { | 25 DesktopEnvironment::~DesktopEnvironment() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 void DesktopEnvironment::SuggestResolution( | 28 void DesktopEnvironment::SuggestResolution( |
| 29 const protocol::SuggestResolutionRequest* msg, Task* done) { | 29 const protocol::SuggestResolutionRequest* msg, Task* done) { |
| 30 done->Run(); | 30 done->Run(); |
| 31 delete done; | 31 delete done; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void DesktopEnvironment::BeginSessionRequest( | 34 void DesktopEnvironment::BeginSessionRequest( |
| 35 const protocol::LocalLoginCredentials* credentials, Task* done) { | 35 protocol::ConnectionToClient* connection, |
| 36 const protocol::LocalLoginCredentials* credentials, |
| 37 Task* done) { |
| 36 DCHECK(event_handler_); | 38 DCHECK(event_handler_); |
| 37 | 39 |
| 38 bool success = false; | 40 bool success = false; |
| 39 scoped_ptr<UserAuthenticator> authenticator(UserAuthenticator::Create()); | 41 scoped_ptr<UserAuthenticator> authenticator(UserAuthenticator::Create()); |
| 40 switch (credentials->type()) { | 42 switch (credentials->type()) { |
| 41 case protocol::PASSWORD: | 43 case protocol::PASSWORD: |
| 42 success = authenticator->Authenticate(credentials->username(), | 44 success = authenticator->Authenticate(credentials->username(), |
| 43 credentials->credential()); | 45 credentials->credential()); |
| 44 break; | 46 break; |
| 45 | 47 |
| 46 default: | 48 default: |
| 47 LOG(ERROR) << "Invalid credentials type " << credentials->type(); | 49 LOG(ERROR) << "Invalid credentials type " << credentials->type(); |
| 48 break; | 50 break; |
| 49 } | 51 } |
| 50 | 52 |
| 51 if (success) { | 53 if (success) { |
| 52 event_handler_->LocalLoginSucceeded(); | 54 event_handler_->LocalLoginSucceeded(connection); |
| 53 } else { | 55 } else { |
| 54 LOG(WARNING) << "Login failed for user " << credentials->username(); | 56 LOG(WARNING) << "Login failed for user " << credentials->username(); |
| 55 event_handler_->LocalLoginFailed(); | 57 event_handler_->LocalLoginFailed(connection); |
| 56 } | 58 } |
| 57 | 59 |
| 58 done->Run(); | 60 done->Run(); |
| 59 delete done; | 61 delete done; |
| 60 } | 62 } |
| 61 | 63 |
| 62 } // namespace remoting | 64 } // namespace remoting |
| OLD | NEW |