| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_TPM_KEY_MANAGER_FA
CTORY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_TPM_KEY_MANAGER_FA
CTORY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_TPM_KEY_MANAGER_FA
CTORY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_TPM_KEY_MANAGER_FA
CTORY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 11 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class BrowserContext; | 14 class BrowserContext; |
| 15 } | 15 } |
| 16 | 16 |
| 17 template <typename T> struct DefaultSingletonTraits; | 17 namespace base { |
| 18 template <typename T> |
| 19 struct DefaultSingletonTraits; |
| 20 } // namespace base |
| 21 |
| 18 class EasyUnlockTpmKeyManager; | 22 class EasyUnlockTpmKeyManager; |
| 19 | 23 |
| 20 // Singleton factory that builds and owns all EasyUnlockTpmKeyManager services. | 24 // Singleton factory that builds and owns all EasyUnlockTpmKeyManager services. |
| 21 class EasyUnlockTpmKeyManagerFactory | 25 class EasyUnlockTpmKeyManagerFactory |
| 22 : public BrowserContextKeyedServiceFactory { | 26 : public BrowserContextKeyedServiceFactory { |
| 23 public: | 27 public: |
| 24 static EasyUnlockTpmKeyManagerFactory* GetInstance(); | 28 static EasyUnlockTpmKeyManagerFactory* GetInstance(); |
| 25 | 29 |
| 26 static EasyUnlockTpmKeyManager* Get(content::BrowserContext* context); | 30 static EasyUnlockTpmKeyManager* Get(content::BrowserContext* context); |
| 27 static EasyUnlockTpmKeyManager* GetForUser(const std::string& user_id); | 31 static EasyUnlockTpmKeyManager* GetForUser(const std::string& user_id); |
| 28 | 32 |
| 29 private: | 33 private: |
| 30 friend struct DefaultSingletonTraits<EasyUnlockTpmKeyManagerFactory>; | 34 friend struct base::DefaultSingletonTraits<EasyUnlockTpmKeyManagerFactory>; |
| 31 | 35 |
| 32 EasyUnlockTpmKeyManagerFactory(); | 36 EasyUnlockTpmKeyManagerFactory(); |
| 33 ~EasyUnlockTpmKeyManagerFactory() override; | 37 ~EasyUnlockTpmKeyManagerFactory() override; |
| 34 | 38 |
| 35 // BrowserContextKeyedServiceFactory: | 39 // BrowserContextKeyedServiceFactory: |
| 36 KeyedService* BuildServiceInstanceFor( | 40 KeyedService* BuildServiceInstanceFor( |
| 37 content::BrowserContext* context) const override; | 41 content::BrowserContext* context) const override; |
| 38 content::BrowserContext* GetBrowserContextToUse( | 42 content::BrowserContext* GetBrowserContextToUse( |
| 39 content::BrowserContext* context) const override; | 43 content::BrowserContext* context) const override; |
| 40 | 44 |
| 41 DISALLOW_COPY_AND_ASSIGN(EasyUnlockTpmKeyManagerFactory); | 45 DISALLOW_COPY_AND_ASSIGN(EasyUnlockTpmKeyManagerFactory); |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_TPM_KEY_MANAGER
_FACTORY_H_ | 48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_TPM_KEY_MANAGER
_FACTORY_H_ |
| OLD | NEW |