blob: 282de107658f9f8dfe3f9b70d0a2dcccadc85f71 [file] [log] [blame]
Qihui Zhao0cfcf2002022-09-09 22:17:291// Copyright 2022 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_AUTOFILL_IBAN_MANAGER_FACTORY_H_
6#define CHROME_BROWSER_AUTOFILL_IBAN_MANAGER_FACTORY_H_
7
8#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
9#include "components/keyed_service/core/keyed_service.h"
10
11namespace base {
12template <typename T>
13struct DefaultSingletonTraits;
14}
15
16class Profile;
17
18namespace autofill {
19
20class IBANManager;
21
22// Singleton that owns all IBANManagers and associates them with Profiles.
23class IBANManagerFactory : public BrowserContextKeyedServiceFactory {
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:
32 friend struct base::DefaultSingletonTraits<IBANManagerFactory>;
33
34 IBANManagerFactory();
35 ~IBANManagerFactory() override;
36
37 // BrowserContextKeyedServiceFactory:
38 KeyedService* BuildServiceInstanceFor(
39 content::BrowserContext* profile) const override;
40 content::BrowserContext* GetBrowserContextToUse(
41 content::BrowserContext* context) const override;
42};
43
44} // namespace autofill
45
46#endif // CHROME_BROWSER_AUTOFILL_IBAN_MANAGER_FACTORY_H_