Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: chromeos/login/auth/stub_authenticator.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/login/auth/stub_authenticator.h ('k') | chromeos/login/auth/user_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/login/auth/stub_authenticator.h ('k') | chromeos/login/auth/user_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698