| 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/profile_dependency_manager.h" | 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 scoped_ptr<WebDatabaseTable>(new LoginsTable())); | 73 scoped_ptr<WebDatabaseTable>(new LoginsTable())); |
| 74 web_database_->AddTable( | 74 web_database_->AddTable( |
| 75 scoped_ptr<WebDatabaseTable>(new TokenServiceTable())); | 75 scoped_ptr<WebDatabaseTable>(new TokenServiceTable())); |
| 76 web_database_->AddTable( | 76 web_database_->AddTable( |
| 77 scoped_ptr<WebDatabaseTable>(new WebAppsTable())); | 77 scoped_ptr<WebDatabaseTable>(new WebAppsTable())); |
| 78 // TODO(thakis): Add a migration to delete the SQL table used by | 78 // TODO(thakis): Add a migration to delete the SQL table used by |
| 79 // WebIntentsTable, then remove this. | 79 // WebIntentsTable, then remove this. |
| 80 web_database_->AddTable( | 80 web_database_->AddTable( |
| 81 scoped_ptr<WebDatabaseTable>(new WebIntentsTable())); | 81 scoped_ptr<WebDatabaseTable>(new WebIntentsTable())); |
| 82 | 82 |
| 83 // TODO (caitkp): Rework the callbacks here. They're ugly. | 83 web_database_->LoadDatabase(); |
| 84 | |
| 85 web_database_->LoadDatabase(WebDatabaseService::InitCallback()); | |
| 86 | 84 |
| 87 autofill_web_data_ = new AutofillWebDataService( | 85 autofill_web_data_ = new AutofillWebDataService( |
| 88 web_database_, base::Bind(&ProfileErrorCallback)); | 86 web_database_, base::Bind(&ProfileErrorCallback)); |
| 89 autofill_web_data_->Init(); | 87 autofill_web_data_->Init(); |
| 90 | 88 |
| 91 web_data_ = new WebDataService( | 89 web_data_ = new WebDataService( |
| 92 web_database_, base::Bind(&ProfileErrorCallback)); | 90 web_database_, base::Bind(&ProfileErrorCallback)); |
| 93 web_data_->Init(); | 91 web_data_->Init(); |
| 94 | 92 |
| 95 BrowserThread::PostTask( | 93 BrowserThread::PostTask( |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 185 } |
| 188 | 186 |
| 189 ProfileKeyedService* | 187 ProfileKeyedService* |
| 190 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { | 188 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { |
| 191 return new WebDataServiceWrapper(profile); | 189 return new WebDataServiceWrapper(profile); |
| 192 } | 190 } |
| 193 | 191 |
| 194 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { | 192 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
| 195 return true; | 193 return true; |
| 196 } | 194 } |
| OLD | NEW |