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

Side by Side Diff: chrome/browser/signin/easy_unlock_service_regular.cc

Issue 1749893002: Fix Smart Lock bugs introduced by change from raw email to AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: 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 | « no previous file | chrome/browser/signin/easy_unlock_service_signin_chromeos.cc » ('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 "chrome/browser/signin/easy_unlock_service_regular.h" 5 #include "chrome/browser/signin/easy_unlock_service_regular.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base64url.h" 10 #include "base/base64url.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 EasyUnlockService::Type EasyUnlockServiceRegular::GetType() const { 156 EasyUnlockService::Type EasyUnlockServiceRegular::GetType() const {
157 return EasyUnlockService::TYPE_REGULAR; 157 return EasyUnlockService::TYPE_REGULAR;
158 } 158 }
159 159
160 AccountId EasyUnlockServiceRegular::GetAccountId() const { 160 AccountId EasyUnlockServiceRegular::GetAccountId() const {
161 const SigninManagerBase* signin_manager = 161 const SigninManagerBase* signin_manager =
162 SigninManagerFactory::GetForProfileIfExists(profile()); 162 SigninManagerFactory::GetForProfileIfExists(profile());
163 // |profile| has to be a signed-in profile with SigninManager already 163 // |profile| has to be a signed-in profile with SigninManager already
164 // created. Otherwise, just crash to collect stack. 164 // created. Otherwise, just crash to collect stack.
165 DCHECK(signin_manager); 165 DCHECK(signin_manager);
166 const std::string user_email = 166 const AccountInfo account_info =
167 signin_manager->GetAuthenticatedAccountInfo().email; 167 signin_manager->GetAuthenticatedAccountInfo();
168 return user_email.empty() 168 return account_info.email.empty()
169 ? EmptyAccountId() 169 ? EmptyAccountId()
170 : AccountId::FromUserEmail(gaia::CanonicalizeEmail(user_email)); 170 : AccountId::FromUserEmailGaiaId(
171 gaia::CanonicalizeEmail(account_info.email),
172 account_info.gaia);
171 } 173 }
172 174
173 void EasyUnlockServiceRegular::LaunchSetup() { 175 void EasyUnlockServiceRegular::LaunchSetup() {
174 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 176 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
175 #if defined(OS_CHROMEOS) 177 #if defined(OS_CHROMEOS)
176 // Force the user to reauthenticate by showing a modal overlay (similar to the 178 // Force the user to reauthenticate by showing a modal overlay (similar to the
177 // lock screen). The password obtained from the reauth is cached for a short 179 // lock screen). The password obtained from the reauth is cached for a short
178 // period of time and used to create the cryptohome keys for sign-in. 180 // period of time and used to create the cryptohome keys for sign-in.
179 if (short_lived_user_context_ && short_lived_user_context_->user_context()) { 181 if (short_lived_user_context_ && short_lived_user_context_->user_context()) {
180 OpenSetupApp(); 182 OpenSetupApp();
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 PA_LOG(INFO) << "Refresh token not yet available, " 679 PA_LOG(INFO) << "Refresh token not yet available, "
678 << "waiting before starting CryptAuth managers"; 680 << "waiting before starting CryptAuth managers";
679 token_service->AddObserver(this); 681 token_service->AddObserver(this);
680 } 682 }
681 683
682 device_manager_->AddObserver(this); 684 device_manager_->AddObserver(this);
683 enrollment_manager_->Start(); 685 enrollment_manager_->Start();
684 device_manager_->Start(); 686 device_manager_->Start();
685 } 687 }
686 #endif 688 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/easy_unlock_service_signin_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698