| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 scoped_ptr<PersonalDataManager> personal_data_manager_; | 30 scoped_ptr<PersonalDataManager> personal_data_manager_; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 PersonalDataManagerServiceImpl::PersonalDataManagerServiceImpl( | 33 PersonalDataManagerServiceImpl::PersonalDataManagerServiceImpl( |
| 34 Profile* profile) { | 34 Profile* profile) { |
| 35 personal_data_manager_.reset(new PersonalDataManager( | 35 personal_data_manager_.reset(new PersonalDataManager( |
| 36 g_browser_process->GetApplicationLocale())); | 36 g_browser_process->GetApplicationLocale())); |
| 37 personal_data_manager_->Init( | 37 personal_data_manager_->Init( |
| 38 AutofillWebDataService::FromBrowserContext(profile), | 38 WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 39 profile, Profile::EXPLICIT_ACCESS), |
| 39 profile->GetPrefs(), | 40 profile->GetPrefs(), |
| 40 profile->IsOffTheRecord()); | 41 profile->IsOffTheRecord()); |
| 41 } | 42 } |
| 42 | 43 |
| 43 PersonalDataManagerServiceImpl::~PersonalDataManagerServiceImpl() {} | 44 PersonalDataManagerServiceImpl::~PersonalDataManagerServiceImpl() {} |
| 44 | 45 |
| 45 void PersonalDataManagerServiceImpl::Shutdown() { | 46 void PersonalDataManagerServiceImpl::Shutdown() { |
| 46 personal_data_manager_.reset(); | 47 personal_data_manager_.reset(); |
| 47 } | 48 } |
| 48 | 49 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile)); | 88 new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile)); |
| 88 return service; | 89 return service; |
| 89 } | 90 } |
| 90 | 91 |
| 91 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse( | 92 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse( |
| 92 content::BrowserContext* context) const { | 93 content::BrowserContext* context) const { |
| 93 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 94 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace autofill | 97 } // namespace autofill |
| OLD | NEW |