| 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/webdata/web_data_service_factory.h" | 5 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.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/profile_dependency_manager.h" | 11 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 #include "chrome/browser/ui/profile_error_dialog.h" | 12 #include "chrome/browser/ui/profile_error_dialog.h" |
| 12 #include "chrome/browser/webdata/autocomplete_syncable_service.h" | 13 #include "chrome/browser/webdata/autocomplete_syncable_service.h" |
| 13 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" | 14 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" |
| 14 #include "chrome/browser/webdata/keyword_table.h" | 15 #include "chrome/browser/webdata/keyword_table.h" |
| 15 #include "chrome/browser/webdata/logins_table.h" | 16 #include "chrome/browser/webdata/logins_table.h" |
| 16 #include "chrome/browser/webdata/token_service_table.h" | 17 #include "chrome/browser/webdata/token_service_table.h" |
| 17 #include "chrome/browser/webdata/web_apps_table.h" | 18 #include "chrome/browser/webdata/web_apps_table.h" |
| 18 #include "chrome/browser/webdata/web_data_service.h" | 19 #include "chrome/browser/webdata/web_data_service.h" |
| 19 #include "chrome/browser/webdata/web_intents_table.h" | 20 #include "chrome/browser/webdata/web_intents_table.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 DCHECK(access_type != Profile::IMPLICIT_ACCESS || !profile->IsOffTheRecord()); | 174 DCHECK(access_type != Profile::IMPLICIT_ACCESS || !profile->IsOffTheRecord()); |
| 174 return static_cast<WebDataServiceWrapper*>( | 175 return static_cast<WebDataServiceWrapper*>( |
| 175 GetInstance()->GetServiceForProfile(profile, false)); | 176 GetInstance()->GetServiceForProfile(profile, false)); |
| 176 } | 177 } |
| 177 | 178 |
| 178 // static | 179 // static |
| 179 WebDataServiceFactory* WebDataServiceFactory::GetInstance() { | 180 WebDataServiceFactory* WebDataServiceFactory::GetInstance() { |
| 180 return Singleton<WebDataServiceFactory>::get(); | 181 return Singleton<WebDataServiceFactory>::get(); |
| 181 } | 182 } |
| 182 | 183 |
| 183 bool WebDataServiceFactory::ServiceRedirectedInIncognito() const { | 184 content::BrowserContext* WebDataServiceFactory::GetBrowserContextToUse( |
| 184 return true; | 185 content::BrowserContext* context) const { |
| 186 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 185 } | 187 } |
| 186 | 188 |
| 187 ProfileKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( | 189 ProfileKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( |
| 188 content::BrowserContext* profile) const { | 190 content::BrowserContext* profile) const { |
| 189 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); | 191 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); |
| 190 } | 192 } |
| 191 | 193 |
| 192 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { | 194 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
| 193 return true; | 195 return true; |
| 194 } | 196 } |
| OLD | NEW |