Avi Drissman | ae7b33a4 | 2022-09-13 16:51:07 | [diff] [blame] | 1 | // Copyright 2022 The Chromium Authors |
Qihui Zhao | 0cfcf200 | 2022-09-09 22:17:29 | [diff] [blame] | 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_AUTOFILL_IBAN_MANAGER_FACTORY_H_ |
| 6 | #define CHROME_BROWSER_AUTOFILL_IBAN_MANAGER_FACTORY_H_ |
| 7 | |
Ryan Sultanem | 421df1e | 2023-01-13 15:05:50 | [diff] [blame] | 8 | #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
Qihui Zhao | 0cfcf200 | 2022-09-09 22:17:29 | [diff] [blame] | 9 | #include "components/keyed_service/core/keyed_service.h" |
| 10 | |
| 11 | namespace base { |
| 12 | template <typename T> |
Mikel Astiz | 77b19d7e | 2023-05-30 06:36:09 | [diff] [blame^] | 13 | class NoDestructor; |
Qihui Zhao | 0cfcf200 | 2022-09-09 22:17:29 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | class Profile; |
| 17 | |
| 18 | namespace autofill { |
| 19 | |
| 20 | class IBANManager; |
| 21 | |
| 22 | // Singleton that owns all IBANManagers and associates them with Profiles. |
Ryan Sultanem | 421df1e | 2023-01-13 15:05:50 | [diff] [blame] | 23 | class IBANManagerFactory : public ProfileKeyedServiceFactory { |
Qihui Zhao | 0cfcf200 | 2022-09-09 22:17:29 | [diff] [blame] | 24 | public: |
| 25 | // Returns the IBANManager for |profile|, creating it if it is not yet |
| 26 | // created. |
| 27 | static IBANManager* GetForProfile(Profile* profile); |
| 28 | |
| 29 | static IBANManagerFactory* GetInstance(); |
| 30 | |
| 31 | private: |
Mikel Astiz | 77b19d7e | 2023-05-30 06:36:09 | [diff] [blame^] | 32 | friend base::NoDestructor<IBANManagerFactory>; |
Qihui Zhao | 0cfcf200 | 2022-09-09 22:17:29 | [diff] [blame] | 33 | |
| 34 | IBANManagerFactory(); |
| 35 | ~IBANManagerFactory() override; |
| 36 | |
| 37 | // BrowserContextKeyedServiceFactory: |
| 38 | KeyedService* BuildServiceInstanceFor( |
| 39 | content::BrowserContext* profile) const override; |
Qihui Zhao | 0cfcf200 | 2022-09-09 22:17:29 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | } // namespace autofill |
| 43 | |
| 44 | #endif // CHROME_BROWSER_AUTOFILL_IBAN_MANAGER_FACTORY_H_ |