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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/personal_data_manager_factory.cc
diff --git a/chrome/browser/autofill/personal_data_manager_factory.cc b/chrome/browser/autofill/personal_data_manager_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1b91b44178c407df89615db0882517d432ccf30e
--- /dev/null
+++ b/chrome/browser/autofill/personal_data_manager_factory.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/autofill/personal_data_manager_factory.h"
+
+#include "base/memory/singleton.h"
+#include "chrome/browser/autofill/personal_data_manager.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_dependency_manager.h"
+
+// static
+PersonalDataManager* PersonalDataManagerFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<PersonalDataManager*>(
+ GetInstance()->GetServiceForProfile(profile, true));
+}
+
+// static
+PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() {
+ return Singleton<PersonalDataManagerFactory>::get();
+}
+
+PersonalDataManagerFactory::PersonalDataManagerFactory()
+ : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ // TODO(erg): For Shutdown() order, we need to:
+ // DependsOn(WebDataServiceFactory::GetInstance());
+}
+
+PersonalDataManagerFactory::~PersonalDataManagerFactory() {
+}
+
+ProfileKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor(
+ Profile* profile) const {
+ PersonalDataManager* personal_data_manager = new PersonalDataManager();
+ personal_data_manager->Init(profile);
+ return personal_data_manager;
+}
« 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