Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / autofill / personal_data_manager_factory.h
blobe0ed3492f36bcc9933bf6ec3f2c1a20d38515e3c
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 namespace base {
13 template <typename T> struct DefaultSingletonTraits;
16 class Profile;
18 namespace autofill {
20 class PersonalDataManager;
22 // Singleton that owns all PersonalDataManagers and associates them with
23 // Profiles.
24 // Listens for the Profile's destruction notification and cleans up the
25 // associated PersonalDataManager.
26 class PersonalDataManagerFactory : public BrowserContextKeyedServiceFactory {
27 public:
28 // Returns the PersonalDataManager for |profile|, creating it if it is not
29 // yet created.
30 static PersonalDataManager* GetForProfile(Profile* profile);
32 static PersonalDataManagerFactory* GetInstance();
34 private:
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_