| 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" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #endif // defined(OS_CHROMEOS) | 45 #endif // defined(OS_CHROMEOS) |
| 46 #endif // defined(GOOGLE_CHROME_BUILD) | 46 #endif // defined(GOOGLE_CHROME_BUILD) |
| 47 | 47 |
| 48 return base::FilePath(); | 48 return base::FilePath(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 // static | 53 // static |
| 54 EasyUnlockServiceFactory* EasyUnlockServiceFactory::GetInstance() { | 54 EasyUnlockServiceFactory* EasyUnlockServiceFactory::GetInstance() { |
| 55 return Singleton<EasyUnlockServiceFactory>::get(); | 55 return base::Singleton<EasyUnlockServiceFactory>::get(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 // static | 58 // static |
| 59 EasyUnlockService* EasyUnlockServiceFactory::GetForBrowserContext( | 59 EasyUnlockService* EasyUnlockServiceFactory::GetForBrowserContext( |
| 60 content::BrowserContext* browser_context) { | 60 content::BrowserContext* browser_context) { |
| 61 return static_cast<EasyUnlockService*>( | 61 return static_cast<EasyUnlockService*>( |
| 62 EasyUnlockServiceFactory::GetInstance()->GetServiceForBrowserContext( | 62 EasyUnlockServiceFactory::GetInstance()->GetServiceForBrowserContext( |
| 63 browser_context, true)); | 63 browser_context, true)); |
| 64 } | 64 } |
| 65 | 65 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool EasyUnlockServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 125 bool EasyUnlockServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool EasyUnlockServiceFactory::ServiceIsNULLWhileTesting() const { | 129 bool EasyUnlockServiceFactory::ServiceIsNULLWhileTesting() const { |
| 130 // 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 |
| 131 // EasyUnlockService uses ExtensionSystem::ready().Post, which expects | 131 // EasyUnlockService uses ExtensionSystem::ready().Post, which expects |
| 132 // a MessageLoop that does not exit in many unit_tests cases. | 132 // a MessageLoop that does not exit in many unit_tests cases. |
| 133 return true; | 133 return true; |
| 134 } | 134 } |
| OLD | NEW |