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"
13 template <typename T
> struct DefaultSingletonTraits
;
20 class PersonalDataManager
;
22 // Singleton that owns all PersonalDataManagers and associates them with
24 // Listens for the Profile's destruction notification and cleans up the
25 // associated PersonalDataManager.
26 class PersonalDataManagerFactory
: public BrowserContextKeyedServiceFactory
{
28 // Returns the PersonalDataManager for |profile|, creating it if it is not
30 static PersonalDataManager
* GetForProfile(Profile
* profile
);
32 static PersonalDataManagerFactory
* GetInstance();
35 friend struct base::DefaultSingletonTraits
<PersonalDataManagerFactory
>;
37 PersonalDataManagerFactory();
38 ~PersonalDataManagerFactory() override
;
40 // BrowserContextKeyedServiceFactory:
41 KeyedService
* BuildServiceInstanceFor(
42 content::BrowserContext
* profile
) const override
;
43 content::BrowserContext
* GetBrowserContextToUse(
44 content::BrowserContext
* context
) const override
;
47 } // namespace autofill
49 #endif // CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_FACTORY_H_