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

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: 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 "chrome/browser/autofill/personal_data_manager.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h"
10
11 // static
12 PersonalDataManager* PersonalDataManagerFactory::GetForProfile(
13 Profile* profile) {
14 return static_cast<PersonalDataManager*>(
15 GetInstance()->GetServiceForProfile(profile, true));
16 }
17
18 // static
19 PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() {
20 return Singleton<PersonalDataManagerFactory>::get();
21 }
22
23 PersonalDataManagerFactory::PersonalDataManagerFactory()
24 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
25 // TODO(erg): For Shutdown() order, we need to:
Ilya Sherman 2011/09/23 03:56:34 Is this TODO intentionally unimplemented for now?
dhollowa 2011/09/23 16:30:03 Yes, this is a note to erg@ to set up dependencies
26 // DependsOn(WebDataServiceFactory::GetInstance());
27 }
28
29 PersonalDataManagerFactory::~PersonalDataManagerFactory() {
30 }
31
32 ProfileKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor(
33 Profile* profile) const {
34 PersonalDataManager* personal_data_manager = new PersonalDataManager();
35 personal_data_manager->Init(profile);
Ilya Sherman 2011/09/23 03:56:34 Do we still need to provide a constructor and an I
dhollowa 2011/09/23 16:30:03 Yes, the two-phase init is required for testing.
36 return personal_data_manager;
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698