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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_FACTORY_H_
8 #include "base/files/file_path.h"
9 #include "base/macros.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
17 template <typename T
> struct DefaultSingletonTraits
;
20 class EasyUnlockService
;
23 // Singleton factory that builds and owns all EasyUnlockService.
24 class EasyUnlockServiceFactory
: public BrowserContextKeyedServiceFactory
{
26 static EasyUnlockServiceFactory
* GetInstance();
28 static EasyUnlockService
* GetForBrowserContext(
29 content::BrowserContext
* browser_context
);
31 void set_app_path_for_testing(const base::FilePath
& app_path
) {
32 app_path_for_testing_
= app_path
;
36 friend struct base::DefaultSingletonTraits
<EasyUnlockServiceFactory
>;
38 EasyUnlockServiceFactory();
39 ~EasyUnlockServiceFactory() override
;
41 // BrowserContextKeyedServiceFactory:
42 KeyedService
* BuildServiceInstanceFor(
43 content::BrowserContext
* context
) const override
;
44 content::BrowserContext
* GetBrowserContextToUse(
45 content::BrowserContext
* context
) const override
;
46 bool ServiceIsCreatedWithBrowserContext() const override
;
47 bool ServiceIsNULLWhileTesting() const override
;
49 base::FilePath app_path_for_testing_
;
51 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceFactory
);
54 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_FACTORY_H_