1 // Copyright (c) 2011 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_AUTOFILL_PERSONAL_DATA_MANAGER_FACTORY_H_
6 #define CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_FACTORY_H_
8 #include "base/compiler_specific.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
10 #include "components/keyed_service/core/keyed_service.h"
12 template <typename T
> struct DefaultSingletonTraits
;
17 class PersonalDataManager
;
19 // Singleton that owns all PersonalDataManagers and associates them with
21 // Listens for the Profile's destruction notification and cleans up the
22 // associated PersonalDataManager.
23 class PersonalDataManagerFactory
: public BrowserContextKeyedServiceFactory
{
25 // Returns the PersonalDataManager for |profile|, creating it if it is not
27 static PersonalDataManager
* GetForProfile(Profile
* profile
);
29 static PersonalDataManagerFactory
* GetInstance();
32 friend struct DefaultSingletonTraits
<PersonalDataManagerFactory
>;
34 PersonalDataManagerFactory();
35 ~PersonalDataManagerFactory() override
;
37 // BrowserContextKeyedServiceFactory:
38 KeyedService
* BuildServiceInstanceFor(
39 content::BrowserContext
* profile
) const override
;
40 content::BrowserContext
* GetBrowserContextToUse(
41 content::BrowserContext
* context
) const override
;
44 } // namespace autofill
46 #endif // CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_FACTORY_H_