| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 6 |
| 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/autofill/personal_data_manager.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 |
| 12 // static |
| 13 PersonalDataManager* PersonalDataManagerFactory::GetForProfile( |
| 14 Profile* profile) { |
| 15 return static_cast<PersonalDataManager*>( |
| 16 GetInstance()->GetServiceForProfile(profile, true)); |
| 17 } |
| 18 |
| 19 // static |
| 20 PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() { |
| 21 return Singleton<PersonalDataManagerFactory>::get(); |
| 22 } |
| 23 |
| 24 PersonalDataManagerFactory::PersonalDataManagerFactory() |
| 25 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
| 26 // TODO(erg): For Shutdown() order, we need to: |
| 27 // DependsOn(WebDataServiceFactory::GetInstance()); |
| 28 } |
| 29 |
| 30 PersonalDataManagerFactory::~PersonalDataManagerFactory() { |
| 31 } |
| 32 |
| 33 ProfileKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor( |
| 34 Profile* profile) const { |
| 35 PersonalDataManager* personal_data_manager = new PersonalDataManager(); |
| 36 personal_data_manager->Init(profile); |
| 37 return personal_data_manager; |
| 38 } |
| OLD | NEW |