| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/login/auth/stub_authenticator.h" | 5 #include "chromeos/login/auth/stub_authenticator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 void StubAuthenticator::LoginAsPublicSession(const UserContext& user_context) { | 69 void StubAuthenticator::LoginAsPublicSession(const UserContext& user_context) { |
| 70 UserContext logged_in_user_context = user_context; | 70 UserContext logged_in_user_context = user_context; |
| 71 logged_in_user_context.SetIsUsingOAuth(false); | 71 logged_in_user_context.SetIsUsingOAuth(false); |
| 72 logged_in_user_context.SetUserIDHash( | 72 logged_in_user_context.SetUserIDHash( |
| 73 logged_in_user_context.GetAccountId().GetUserEmail() + kUserIdHashSuffix); | 73 logged_in_user_context.GetAccountId().GetUserEmail() + kUserIdHashSuffix); |
| 74 consumer_->OnAuthSuccess(logged_in_user_context); | 74 consumer_->OnAuthSuccess(logged_in_user_context); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void StubAuthenticator::LoginAsKioskAccount( | 77 void StubAuthenticator::LoginAsKioskAccount( |
| 78 const std::string& /* app_user_id */, | 78 const AccountId& /* app_account_id */, |
| 79 bool use_guest_mount) { | 79 bool use_guest_mount) { |
| 80 UserContext user_context(expected_user_context_.GetAccountId()); | 80 UserContext user_context(expected_user_context_.GetAccountId()); |
| 81 user_context.SetIsUsingOAuth(false); | 81 user_context.SetIsUsingOAuth(false); |
| 82 user_context.SetUserIDHash( | 82 user_context.SetUserIDHash( |
| 83 expected_user_context_.GetAccountId().GetUserEmail() + kUserIdHashSuffix); | 83 expected_user_context_.GetAccountId().GetUserEmail() + kUserIdHashSuffix); |
| 84 consumer_->OnAuthSuccess(user_context); | 84 consumer_->OnAuthSuccess(user_context); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void StubAuthenticator::OnAuthSuccess() { | 87 void StubAuthenticator::OnAuthSuccess() { |
| 88 // If we want to be more like the real thing, we could save the user ID | 88 // If we want to be more like the real thing, we could save the user ID |
| (...skipping 16 matching lines...) Expand all Loading... |
| 105 | 105 |
| 106 void StubAuthenticator::SetExpectedCredentials( | 106 void StubAuthenticator::SetExpectedCredentials( |
| 107 const UserContext& user_context) { | 107 const UserContext& user_context) { |
| 108 expected_user_context_ = user_context; | 108 expected_user_context_ = user_context; |
| 109 } | 109 } |
| 110 | 110 |
| 111 StubAuthenticator::~StubAuthenticator() { | 111 StubAuthenticator::~StubAuthenticator() { |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace chromeos | 114 } // namespace chromeos |
| OLD | NEW |