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

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

Issue 834233005: Make Easy Unlock app have separate instance in incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 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 | « chrome/browser/signin/easy_unlock_service.cc ('k') | no next file » | 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_factory.h" 5 #include "chrome/browser/signin/easy_unlock_service_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/profiles/incognito_helpers.h" 8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/easy_unlock_service.h" 10 #include "chrome/browser/signin/easy_unlock_service.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 EasyUnlockServiceFactory::~EasyUnlockServiceFactory() { 45 EasyUnlockServiceFactory::~EasyUnlockServiceFactory() {
46 } 46 }
47 47
48 KeyedService* EasyUnlockServiceFactory::BuildServiceInstanceFor( 48 KeyedService* EasyUnlockServiceFactory::BuildServiceInstanceFor(
49 content::BrowserContext* context) const { 49 content::BrowserContext* context) const {
50 #if defined(OS_CHROMEOS) 50 #if defined(OS_CHROMEOS)
51 if (chromeos::ProfileHelper::IsSigninProfile( 51 if (chromeos::ProfileHelper::IsSigninProfile(
52 Profile::FromBrowserContext(context))) { 52 Profile::FromBrowserContext(context))) {
53 if (EasyUnlockService::IsSignInEnabled()) { 53 if (EasyUnlockService::IsSignInEnabled() && context->IsOffTheRecord()) {
54 return new EasyUnlockServiceSignin(Profile::FromBrowserContext(context)); 54 return new EasyUnlockServiceSignin(Profile::FromBrowserContext(context));
55 } else { 55 } else {
56 return NULL; 56 return NULL;
57 } 57 }
58 } 58 }
59 #endif 59 #endif
60 return new EasyUnlockServiceRegular(Profile::FromBrowserContext(context)); 60 return new EasyUnlockServiceRegular(Profile::FromBrowserContext(context));
61 } 61 }
62 62
63 content::BrowserContext* EasyUnlockServiceFactory::GetBrowserContextToUse( 63 content::BrowserContext* EasyUnlockServiceFactory::GetBrowserContextToUse(
64 content::BrowserContext* context) const { 64 content::BrowserContext* context) const {
65 #if defined(OS_CHROMEOS)
66 if (chromeos::ProfileHelper::IsSigninProfile(
67 Profile::FromBrowserContext(context))) {
68 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
69 }
70 #endif
65 return chrome::GetBrowserContextRedirectedInIncognito(context); 71 return chrome::GetBrowserContextRedirectedInIncognito(context);
66 } 72 }
67 73
68 bool EasyUnlockServiceFactory::ServiceIsCreatedWithBrowserContext() const { 74 bool EasyUnlockServiceFactory::ServiceIsCreatedWithBrowserContext() const {
69 return true; 75 return true;
70 } 76 }
71 77
72 bool EasyUnlockServiceFactory::ServiceIsNULLWhileTesting() const { 78 bool EasyUnlockServiceFactory::ServiceIsNULLWhileTesting() const {
73 // Don't create the service for TestingProfile used in unit_tests because 79 // Don't create the service for TestingProfile used in unit_tests because
74 // EasyUnlockService uses ExtensionSystem::ready().Post, which expects 80 // EasyUnlockService uses ExtensionSystem::ready().Post, which expects
75 // a MessageLoop that does not exit in many unit_tests cases. 81 // a MessageLoop that does not exit in many unit_tests cases.
76 return true; 82 return true;
77 } 83 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698