| 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/incognito_helpers.h" |
| 11 #include "chrome/browser/sync/glue/sync_start_util.h" | 11 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 12 #include "chrome/browser/ui/profile_error_dialog.h" | 12 #include "chrome/browser/ui/profile_error_dialog.h" |
| 13 #include "chrome/browser/webdata/autocomplete_syncable_service.h" | 13 #include "chrome/browser/webdata/autocomplete_syncable_service.h" |
| 14 #include "chrome/browser/webdata/web_apps_table.h" | |
| 15 #include "chrome/browser/webdata/web_intents_table.h" | |
| 16 #include "components/autofill/core/browser/autofill_country.h" | 14 #include "components/autofill/core/browser/autofill_country.h" |
| 17 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" | 15 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" |
| 18 #include "components/autofill/core/browser/webdata/autofill_table.h" | 16 #include "components/autofill/core/browser/webdata/autofill_table.h" |
| 19 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 17 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 20 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 18 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 21 #include "components/password_manager/core/browser/webdata/logins_table.h" | 19 #include "components/password_manager/core/browser/webdata/logins_table.h" |
| 22 #include "components/search_engines/keyword_table.h" | 20 #include "components/search_engines/keyword_table.h" |
| 23 #include "components/search_engines/keyword_web_data_service.h" | 21 #include "components/search_engines/keyword_web_data_service.h" |
| 24 #include "components/signin/core/browser/webdata/token_service_table.h" | 22 #include "components/signin/core/browser/webdata/token_service_table.h" |
| 25 #include "components/signin/core/browser/webdata/token_web_data.h" | 23 #include "components/signin/core/browser/webdata/token_web_data.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // be added here. | 84 // be added here. |
| 87 web_database_->AddTable(scoped_ptr<WebDatabaseTable>( | 85 web_database_->AddTable(scoped_ptr<WebDatabaseTable>( |
| 88 new autofill::AutofillTable(g_browser_process->GetApplicationLocale()))); | 86 new autofill::AutofillTable(g_browser_process->GetApplicationLocale()))); |
| 89 web_database_->AddTable(scoped_ptr<WebDatabaseTable>(new KeywordTable())); | 87 web_database_->AddTable(scoped_ptr<WebDatabaseTable>(new KeywordTable())); |
| 90 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password | 88 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password |
| 91 // access, but for now, we still create it on all platforms since it deletes | 89 // access, but for now, we still create it on all platforms since it deletes |
| 92 // the old logins table. We can remove this after a while, e.g. in M22 or so. | 90 // the old logins table. We can remove this after a while, e.g. in M22 or so. |
| 93 web_database_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable())); | 91 web_database_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable())); |
| 94 web_database_->AddTable( | 92 web_database_->AddTable( |
| 95 scoped_ptr<WebDatabaseTable>(new TokenServiceTable())); | 93 scoped_ptr<WebDatabaseTable>(new TokenServiceTable())); |
| 96 // TODO(caitkp): Add a migration to delete the SQL table used by | |
| 97 // WebIntentsTable, then remove this. | |
| 98 web_database_->AddTable(scoped_ptr<WebDatabaseTable>(new WebAppsTable())); | |
| 99 // TODO(thakis): Add a migration to delete the SQL table used by | |
| 100 // WebIntentsTable, then remove this. | |
| 101 web_database_->AddTable(scoped_ptr<WebDatabaseTable>(new WebIntentsTable())); | |
| 102 | 94 |
| 103 web_database_->LoadDatabase(); | 95 web_database_->LoadDatabase(); |
| 104 | 96 |
| 105 autofill_web_data_ = new AutofillWebDataService( | 97 autofill_web_data_ = new AutofillWebDataService( |
| 106 web_database_, | 98 web_database_, |
| 107 ui_thread, | 99 ui_thread, |
| 108 db_thread, | 100 db_thread, |
| 109 base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_AUTOFILL_WEB_DATA)); | 101 base::Bind(&ProfileErrorCallback, PROFILE_ERROR_DB_AUTOFILL_WEB_DATA)); |
| 110 autofill_web_data_->Init(); | 102 autofill_web_data_->Init(); |
| 111 | 103 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 260 } |
| 269 | 261 |
| 270 KeyedService* WebDataServiceFactory::BuildServiceInstanceFor( | 262 KeyedService* WebDataServiceFactory::BuildServiceInstanceFor( |
| 271 content::BrowserContext* profile) const { | 263 content::BrowserContext* profile) const { |
| 272 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); | 264 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); |
| 273 } | 265 } |
| 274 | 266 |
| 275 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { | 267 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
| 276 return true; | 268 return true; |
| 277 } | 269 } |
| OLD | NEW |