| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 PersonalDataManagerFactory::~PersonalDataManagerFactory() { | 38 PersonalDataManagerFactory::~PersonalDataManagerFactory() { |
| 39 } | 39 } |
| 40 | 40 |
| 41 KeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor( | 41 KeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor( |
| 42 content::BrowserContext* context) const { | 42 content::BrowserContext* context) const { |
| 43 Profile* profile = Profile::FromBrowserContext(context); | 43 Profile* profile = Profile::FromBrowserContext(context); |
| 44 PersonalDataManager* service = | 44 PersonalDataManager* service = |
| 45 new PersonalDataManager(g_browser_process->GetApplicationLocale()); | 45 new PersonalDataManager(g_browser_process->GetApplicationLocale()); |
| 46 service->Init(WebDataServiceFactory::GetAutofillWebDataForProfile( | 46 service->Init(WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 47 profile, Profile::EXPLICIT_ACCESS), | 47 profile, ServiceAccessType::EXPLICIT_ACCESS), |
| 48 profile->GetPrefs(), | 48 profile->GetPrefs(), |
| 49 profile->IsOffTheRecord()); | 49 profile->IsOffTheRecord()); |
| 50 return service; | 50 return service; |
| 51 } | 51 } |
| 52 | 52 |
| 53 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse( | 53 content::BrowserContext* PersonalDataManagerFactory::GetBrowserContextToUse( |
| 54 content::BrowserContext* context) const { | 54 content::BrowserContext* context) const { |
| 55 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 55 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace autofill | 58 } // namespace autofill |
| OLD | NEW |