| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |