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

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

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/autofill/personal_data_manager_factory.h" 5 #include "chrome/browser/autofill/personal_data_manager_factory.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/incognito_helpers.h" 10 #include "chrome/browser/profiles/incognito_helpers.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return personal_data_manager_.get(); 46 return personal_data_manager_.get();
47 } 47 }
48 48
49 } // namespace 49 } // namespace
50 50
51 // static 51 // static
52 PersonalDataManager* PersonalDataManagerFactory::GetForProfile( 52 PersonalDataManager* PersonalDataManagerFactory::GetForProfile(
53 Profile* profile) { 53 Profile* profile) {
54 PersonalDataManagerService* service = 54 PersonalDataManagerService* service =
55 static_cast<PersonalDataManagerService*>( 55 static_cast<PersonalDataManagerService*>(
56 GetInstance()->GetServiceForProfile(profile, true)); 56 GetInstance()->GetServiceForBrowserContext(profile, true));
57 57
58 if (service) 58 if (service)
59 return service->GetPersonalDataManager(); 59 return service->GetPersonalDataManager();
60 60
61 // |service| can be NULL in Incognito mode. 61 // |service| can be NULL in Incognito mode.
62 return NULL; 62 return NULL;
63 } 63 }
64 64
65 // static 65 // static
66 PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() { 66 PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() {
67 return Singleton<PersonalDataManagerFactory>::get(); 67 return Singleton<PersonalDataManagerFactory>::get();
68 } 68 }
69 69
70 PersonalDataManagerFactory::PersonalDataManagerFactory() 70 PersonalDataManagerFactory::PersonalDataManagerFactory()
71 : ProfileKeyedServiceFactory("PersonalDataManager", 71 : BrowserContextKeyedServiceFactory(
72 ProfileDependencyManager::GetInstance()) { 72 "PersonalDataManager",
73 BrowserContextDependencyManager::GetInstance()) {
73 DependsOn(WebDataServiceFactory::GetInstance()); 74 DependsOn(WebDataServiceFactory::GetInstance());
74 } 75 }
75 76
76 PersonalDataManagerFactory::~PersonalDataManagerFactory() { 77 PersonalDataManagerFactory::~PersonalDataManagerFactory() {
77 } 78 }
78 79
79 ProfileKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor( 80 BrowserContextKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor(
80 content::BrowserContext* profile) const { 81 content::BrowserContext* profile) const {
81 PersonalDataManagerService* service = 82 PersonalDataManagerService* service =
82 new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile)); 83 new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile));
83 return service; 84 return service;
84 } 85 }
85 86
86 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse( 87 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse(
87 content::BrowserContext* context) const { 88 content::BrowserContext* context) const {
88 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 89 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
89 } 90 }
90 91
91 } // namespace autofill 92 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698