Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/autofill/personal_data_manager_factory.cc

Issue 7967024: Profile shouldn't own PersonalDataManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addresses isherman #11 Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/personal_data_manager_factory.h ('k') | chrome/browser/autofill/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698