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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
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 | 74 |
74 // All tables objects that participate in managing the database must | 75 // All tables objects that participate in managing the database must |
75 // be added here. | 76 // be added here. |
76 web_database_->AddTable( | 77 web_database_->AddTable( |
77 scoped_ptr<WebDatabaseTable>(new autofill::AutofillTable( | 78 scoped_ptr<WebDatabaseTable>(new autofill::AutofillTable( |
78 g_browser_process->GetApplicationLocale()))); | 79 g_browser_process->GetApplicationLocale()))); |
79 web_database_->AddTable( | 80 web_database_->AddTable( |
80 scoped_ptr<WebDatabaseTable>(new KeywordTable())); | 81 scoped_ptr<WebDatabaseTable>(new KeywordTable())); |
81 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password | 82 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password |
82 // access, but for now, we still create it on all platforms since it deletes | 83 // 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... |
223 } | 224 } |
224 | 225 |
225 BrowserContextKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( | 226 BrowserContextKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( |
226 content::BrowserContext* profile) const { | 227 content::BrowserContext* profile) const { |
227 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); | 228 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); |
228 } | 229 } |
229 | 230 |
230 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { | 231 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
231 return true; | 232 return true; |
232 } | 233 } |
OLD | NEW |