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

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

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 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
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"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/signin/account_tracker_service_factory.h" 12 #include "chrome/browser/signin/account_tracker_service_factory.h"
13 #include "chrome/browser/web_data_service_factory.h" 13 #include "chrome/browser/web_data_service_factory.h"
14 #include "components/autofill/core/browser/personal_data_manager.h" 14 #include "components/autofill/core/browser/personal_data_manager.h"
15 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 15 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
16 #include "components/keyed_service/content/browser_context_dependency_manager.h" 16 #include "components/keyed_service/content/browser_context_dependency_manager.h"
17 #include "components/signin/core/browser/account_tracker_service.h" 17 #include "components/signin/core/browser/account_tracker_service.h"
18 18
19 namespace autofill { 19 namespace autofill {
20 20
21 // static 21 // static
22 PersonalDataManager* PersonalDataManagerFactory::GetForProfile( 22 PersonalDataManager* PersonalDataManagerFactory::GetForProfile(
23 Profile* profile) { 23 Profile* profile) {
24 return static_cast<PersonalDataManager*>( 24 return static_cast<PersonalDataManager*>(
25 GetInstance()->GetServiceForBrowserContext(profile, true)); 25 GetInstance()->GetServiceForBrowserContext(profile, true));
26 } 26 }
27 27
28 // static 28 // static
29 PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() { 29 PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() {
30 return Singleton<PersonalDataManagerFactory>::get(); 30 return base::Singleton<PersonalDataManagerFactory>::get();
31 } 31 }
32 32
33 PersonalDataManagerFactory::PersonalDataManagerFactory() 33 PersonalDataManagerFactory::PersonalDataManagerFactory()
34 : BrowserContextKeyedServiceFactory( 34 : BrowserContextKeyedServiceFactory(
35 "PersonalDataManager", 35 "PersonalDataManager",
36 BrowserContextDependencyManager::GetInstance()) { 36 BrowserContextDependencyManager::GetInstance()) {
37 DependsOn(AccountTrackerServiceFactory::GetInstance()); 37 DependsOn(AccountTrackerServiceFactory::GetInstance());
38 DependsOn(WebDataServiceFactory::GetInstance()); 38 DependsOn(WebDataServiceFactory::GetInstance());
39 } 39 }
40 40
(...skipping 12 matching lines...) Expand all
53 profile->IsOffTheRecord()); 53 profile->IsOffTheRecord());
54 return service; 54 return service;
55 } 55 }
56 56
57 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse( 57 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse(
58 content::BrowserContext* context) const { 58 content::BrowserContext* context) const {
59 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 59 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
60 } 60 }
61 61
62 } // namespace autofill 62 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698