| 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" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| 65 | 65 |
| 66 WebDataServiceWrapper::WebDataServiceWrapper() {} | 66 WebDataServiceWrapper::WebDataServiceWrapper() {} |
| 67 | 67 |
| 68 WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) { | 68 WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) { |
| 69 base::FilePath profile_path = profile->GetPath(); | 69 base::FilePath profile_path = profile->GetPath(); |
| 70 base::FilePath path = profile_path.Append(kWebDataFilename); | 70 base::FilePath path = profile_path.Append(kWebDataFilename); |
| 71 | 71 |
| 72 web_database_ = new WebDatabaseService(path, | 72 web_database_ = new WebDatabaseService(path, |
| 73 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); | 73 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 74 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB)); |
| 74 | 75 |
| 75 // All tables objects that participate in managing the database must | 76 // All tables objects that participate in managing the database must |
| 76 // be added here. | 77 // be added here. |
| 77 web_database_->AddTable( | 78 web_database_->AddTable( |
| 78 scoped_ptr<WebDatabaseTable>(new autofill::AutofillTable( | 79 scoped_ptr<WebDatabaseTable>(new autofill::AutofillTable( |
| 79 g_browser_process->GetApplicationLocale()))); | 80 g_browser_process->GetApplicationLocale()))); |
| 80 web_database_->AddTable( | 81 web_database_->AddTable( |
| 81 scoped_ptr<WebDatabaseTable>(new KeywordTable())); | 82 scoped_ptr<WebDatabaseTable>(new KeywordTable())); |
| 82 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password | 83 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password |
| 83 // access, but for now, we still create it on all platforms since it deletes | 84 // access, but for now, we still create it on all platforms since it deletes |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 225 } |
| 225 | 226 |
| 226 BrowserContextKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( | 227 BrowserContextKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( |
| 227 content::BrowserContext* profile) const { | 228 content::BrowserContext* profile) const { |
| 228 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); | 229 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); |
| 229 } | 230 } |
| 230 | 231 |
| 231 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { | 232 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
| 232 return true; | 233 return true; |
| 233 } | 234 } |
| OLD | NEW |