Commit 0ac68ed5 authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

cros: Fix easy unlock app causing crash on login screen.

EasyUnlockService is created with profile. Previous code to prevent
it from being created on login screen does not work for all cases.
Move the logic to EasyUnlockServiceFactory::GetBrowserContextToUse
fixes the issue.

BUG=399705
TBR=rogerta@chromium.org

Review URL: https://codereview.chromium.org/423363004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287176 0039d316-1c4b-4281-b951-d872f2087c98
parent 442233d4
......@@ -23,10 +23,6 @@ EasyUnlockServiceFactory* EasyUnlockServiceFactory::GetInstance() {
// static
EasyUnlockService* EasyUnlockServiceFactory::GetForProfile(Profile* profile) {
#if defined(OS_CHROMEOS)
if (chromeos::ProfileHelper::IsSigninProfile(profile))
return NULL;
#endif
return static_cast<EasyUnlockService*>(
EasyUnlockServiceFactory::GetInstance()->GetServiceForBrowserContext(
profile, true));
......@@ -50,6 +46,12 @@ KeyedService* EasyUnlockServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* EasyUnlockServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
#if defined(OS_CHROMEOS)
if (chromeos::ProfileHelper::IsSigninProfile(
Profile::FromBrowserContext(context))) {
return NULL;
}
#endif
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment