| Index: chrome/browser/signin/easy_unlock_service_regular.cc
|
| diff --git a/chrome/browser/signin/easy_unlock_service_regular.cc b/chrome/browser/signin/easy_unlock_service_regular.cc
|
| index a7f8ea9568613448e73a1a1a5fbbb29121bfd9ab..81dcea2a381282b980fd3481eb4feb30d0d410fd 100644
|
| --- a/chrome/browser/signin/easy_unlock_service_regular.cc
|
| +++ b/chrome/browser/signin/easy_unlock_service_regular.cc
|
| @@ -13,8 +13,8 @@
|
| #include "base/version.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/signin/easy_unlock_util.h"
|
| #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
|
| -#include "chrome/browser/signin/screenlock_bridge.h"
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| #include "chrome/common/chrome_version_info.h"
|
| #include "chrome/common/extensions/api/easy_unlock_private.h"
|
| @@ -24,6 +24,7 @@
|
| #include "components/pref_registry/pref_registry_syncable.h"
|
| #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h"
|
| #include "components/proximity_auth/cryptauth/cryptauth_client_impl.h"
|
| +#include "components/proximity_auth/screenlock_bridge.h"
|
| #include "components/proximity_auth/switches.h"
|
| #include "components/signin/core/browser/profile_oauth2_token_service.h"
|
| #include "components/signin/core/browser/signin_manager.h"
|
| @@ -92,7 +93,12 @@ EasyUnlockService::Type EasyUnlockServiceRegular::GetType() const {
|
| }
|
|
|
| std::string EasyUnlockServiceRegular::GetUserEmail() const {
|
| - return ScreenlockBridge::GetAuthenticatedUserEmail(profile());
|
| + const SigninManagerBase* signin_manager =
|
| + SigninManagerFactory::GetForProfileIfExists(profile());
|
| + // |profile| has to be a signed-in profile with SigninManager already
|
| + // created. Otherwise, just crash to collect stack.
|
| + CHECK(signin_manager);
|
| + return signin_manager->GetAuthenticatedUsername();
|
| }
|
|
|
| void EasyUnlockServiceRegular::LaunchSetup() {
|
| @@ -298,7 +304,7 @@ void EasyUnlockServiceRegular::SetAutoPairingResult(
|
| }
|
|
|
| void EasyUnlockServiceRegular::InitializeInternal() {
|
| - ScreenlockBridge::Get()->AddObserver(this);
|
| + GetScreenlockBridgeInstance()->AddObserver(this);
|
| registrar_.Init(profile()->GetPrefs());
|
| registrar_.Add(
|
| prefs::kEasyUnlockAllowed,
|
| @@ -317,7 +323,7 @@ void EasyUnlockServiceRegular::ShutdownInternal() {
|
|
|
| turn_off_flow_status_ = EasyUnlockService::IDLE;
|
| registrar_.RemoveAll();
|
| - ScreenlockBridge::Get()->RemoveObserver(this);
|
| + GetScreenlockBridgeInstance()->RemoveObserver(this);
|
| }
|
|
|
| bool EasyUnlockServiceRegular::IsAllowedInternal() const {
|
|
|