| 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_factory.h" | 5 #include "chrome/browser/signin/easy_unlock_service_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 11 #include "chrome/browser/signin/easy_unlock_app_manager.h" | 12 #include "chrome/browser/signin/easy_unlock_app_manager.h" |
| 12 #include "chrome/browser/signin/easy_unlock_service.h" | 13 #include "chrome/browser/signin/easy_unlock_service.h" |
| 13 #include "chrome/browser/signin/easy_unlock_service_regular.h" | 14 #include "chrome/browser/signin/easy_unlock_service_regular.h" |
| 14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 15 #include "chrome/browser/signin/signin_manager_factory.h" | 16 #include "chrome/browser/signin/signin_manager_factory.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 18 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 18 #include "extensions/browser/extension_system.h" | 19 #include "extensions/browser/extension_system.h" |
| 19 #include "extensions/browser/extension_system_provider.h" | 20 #include "extensions/browser/extension_system_provider.h" |
| 20 #include "extensions/browser/extensions_browser_client.h" | 21 #include "extensions/browser/extensions_browser_client.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 64 } |
| 64 | 65 |
| 65 EasyUnlockServiceFactory::EasyUnlockServiceFactory() | 66 EasyUnlockServiceFactory::EasyUnlockServiceFactory() |
| 66 : BrowserContextKeyedServiceFactory( | 67 : BrowserContextKeyedServiceFactory( |
| 67 "EasyUnlockService", | 68 "EasyUnlockService", |
| 68 BrowserContextDependencyManager::GetInstance()) { | 69 BrowserContextDependencyManager::GetInstance()) { |
| 69 DependsOn( | 70 DependsOn( |
| 70 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 71 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 71 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); | 72 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); |
| 72 DependsOn(SigninManagerFactory::GetInstance()); | 73 DependsOn(SigninManagerFactory::GetInstance()); |
| 74 DependsOn(gcm::GCMProfileServiceFactory::GetInstance()); |
| 73 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
| 74 DependsOn(EasyUnlockTpmKeyManagerFactory::GetInstance()); | 76 DependsOn(EasyUnlockTpmKeyManagerFactory::GetInstance()); |
| 75 #endif | 77 #endif |
| 76 } | 78 } |
| 77 | 79 |
| 78 EasyUnlockServiceFactory::~EasyUnlockServiceFactory() { | 80 EasyUnlockServiceFactory::~EasyUnlockServiceFactory() { |
| 79 } | 81 } |
| 80 | 82 |
| 81 KeyedService* EasyUnlockServiceFactory::BuildServiceInstanceFor( | 83 KeyedService* EasyUnlockServiceFactory::BuildServiceInstanceFor( |
| 82 content::BrowserContext* context) const { | 84 content::BrowserContext* context) const { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool EasyUnlockServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 125 bool EasyUnlockServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
| 124 return true; | 126 return true; |
| 125 } | 127 } |
| 126 | 128 |
| 127 bool EasyUnlockServiceFactory::ServiceIsNULLWhileTesting() const { | 129 bool EasyUnlockServiceFactory::ServiceIsNULLWhileTesting() const { |
| 128 // Don't create the service for TestingProfile used in unit_tests because | 130 // Don't create the service for TestingProfile used in unit_tests because |
| 129 // EasyUnlockService uses ExtensionSystem::ready().Post, which expects | 131 // EasyUnlockService uses ExtensionSystem::ready().Post, which expects |
| 130 // a MessageLoop that does not exit in many unit_tests cases. | 132 // a MessageLoop that does not exit in many unit_tests cases. |
| 131 return true; | 133 return true; |
| 132 } | 134 } |
| OLD | NEW |