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

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

Issue 52713006: Parameterize the PrefService that PersonalDataManager uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review, fix unit tests Created 7 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_autofill_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15 matching lines...) Expand all
26 virtual PersonalDataManager* GetPersonalDataManager() OVERRIDE; 26 virtual PersonalDataManager* GetPersonalDataManager() OVERRIDE;
27 27
28 private: 28 private:
29 scoped_ptr<PersonalDataManager> personal_data_manager_; 29 scoped_ptr<PersonalDataManager> personal_data_manager_;
30 }; 30 };
31 31
32 PersonalDataManagerServiceImpl::PersonalDataManagerServiceImpl( 32 PersonalDataManagerServiceImpl::PersonalDataManagerServiceImpl(
33 Profile* profile) { 33 Profile* profile) {
34 personal_data_manager_.reset(new PersonalDataManager( 34 personal_data_manager_.reset(new PersonalDataManager(
35 g_browser_process->GetApplicationLocale())); 35 g_browser_process->GetApplicationLocale()));
36 personal_data_manager_->Init(profile); 36 personal_data_manager_->Init(profile, profile->GetPrefs());
37 } 37 }
38 38
39 PersonalDataManagerServiceImpl::~PersonalDataManagerServiceImpl() {} 39 PersonalDataManagerServiceImpl::~PersonalDataManagerServiceImpl() {}
40 40
41 void PersonalDataManagerServiceImpl::Shutdown() { 41 void PersonalDataManagerServiceImpl::Shutdown() {
42 personal_data_manager_.reset(); 42 personal_data_manager_.reset();
43 } 43 }
44 44
45 PersonalDataManager* PersonalDataManagerServiceImpl::GetPersonalDataManager() { 45 PersonalDataManager* PersonalDataManagerServiceImpl::GetPersonalDataManager() {
46 return personal_data_manager_.get(); 46 return personal_data_manager_.get();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile)); 83 new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile));
84 return service; 84 return service;
85 } 85 }
86 86
87 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse( 87 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse(
88 content::BrowserContext* context) const { 88 content::BrowserContext* context) const {
89 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 89 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
90 } 90 }
91 91
92 } // namespace autofill 92 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_autofill_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698