OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FINGERPRINT_UNLOCK_FACTORY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FINGERPRINT_UNLOCK_FACTORY_H_ |
| 7 |
| 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 #include "components/signin/core/account_id/account_id.h" |
| 11 |
| 12 class Profile; |
| 13 |
| 14 namespace user_manager { |
| 15 class User; |
| 16 } |
| 17 |
| 18 namespace chromeos { |
| 19 namespace quick_unlock { |
| 20 |
| 21 class FingerprintUnlock; |
| 22 |
| 23 // Singleton that owns all FingerprintUnlock instances and associates them with |
| 24 // Profiles. Listens for the Profile's destruction notification and cleans up |
| 25 // the associated FingerprintUnlock. |
| 26 class FingerprintUnlockFactory : public BrowserContextKeyedServiceFactory { |
| 27 public: |
| 28 // Returns the FingerprintUnlock instance for |profile|. |
| 29 static FingerprintUnlock* GetForProfile(Profile* profile); |
| 30 |
| 31 // Helper method that finds the FingerprintUnlock instance for |user|. This |
| 32 // returns GetForProfile with the profile associated with |user|. |
| 33 static FingerprintUnlock* GetForUser(const user_manager::User* user); |
| 34 |
| 35 // Helper method that returns the FingerprintUnlock instance for |account_id|. |
| 36 // This returns GetForProfile with the profile associated with |account_id|. |
| 37 static FingerprintUnlock* GetForAccountId(const AccountId& account_id); |
| 38 |
| 39 static FingerprintUnlockFactory* GetInstance(); |
| 40 |
| 41 private: |
| 42 friend struct base::DefaultSingletonTraits<FingerprintUnlockFactory>; |
| 43 |
| 44 FingerprintUnlockFactory(); |
| 45 ~FingerprintUnlockFactory() override; |
| 46 |
| 47 // BrowserContextKeyedServiceFactory: |
| 48 KeyedService* BuildServiceInstanceFor( |
| 49 content::BrowserContext* profile) const override; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(FingerprintUnlockFactory); |
| 52 }; |
| 53 |
| 54 } // namespace quick_unlock |
| 55 } // namespace chromeos |
| 56 |
| 57 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FINGERPRINT_UNLOCK_FACTORY
_H_ |
OLD | NEW |