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/profiles/profile_dependency_manager.h" | 9 #include "chrome/browser/profiles/profile_dependency_manager.h" |
10 #include "chrome/browser/ui/profile_error_dialog.h" | 10 #include "chrome/browser/ui/profile_error_dialog.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 WebDataServiceWrapper::WebDataServiceWrapper() {} | 50 WebDataServiceWrapper::WebDataServiceWrapper() {} |
51 | 51 |
52 WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) { | 52 WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) { |
53 base::FilePath path = profile->GetPath(); | 53 base::FilePath path = profile->GetPath(); |
54 path = path.Append(kWebDataFilename); | 54 path = path.Append(kWebDataFilename); |
55 | 55 |
56 web_database_ = new WebDatabaseService( | 56 web_database_ = new WebDatabaseService(path); |
57 path, AutofillCountry::ApplicationLocale()); | |
58 | 57 |
59 // All tables objects that participate in managing the database must | 58 // All tables objects that participate in managing the database must |
60 // be added here. | 59 // be added here. |
61 web_database_->AddTable( | 60 web_database_->AddTable( |
62 scoped_ptr<WebDatabaseTable>(new AutofillTable())); | 61 scoped_ptr<WebDatabaseTable>(new AutofillTable())); |
63 web_database_->AddTable( | 62 web_database_->AddTable( |
64 scoped_ptr<WebDatabaseTable>(new KeywordTable())); | 63 scoped_ptr<WebDatabaseTable>(new KeywordTable())); |
65 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password | 64 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password |
66 // access, but for now, we still create it on all platforms since it deletes | 65 // access, but for now, we still create it on all platforms since it deletes |
67 // the old logins table. We can remove this after a while, e.g. in M22 or so. | 66 // the old logins table. We can remove this after a while, e.g. in M22 or so. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 180 } |
182 | 181 |
183 ProfileKeyedService* | 182 ProfileKeyedService* |
184 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { | 183 WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { |
185 return new WebDataServiceWrapper(profile); | 184 return new WebDataServiceWrapper(profile); |
186 } | 185 } |
187 | 186 |
188 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { | 187 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
189 return true; | 188 return true; |
190 } | 189 } |
OLD | NEW |