OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/webdata_services/web_data_service_wrapper.h" | 5 #include "components/webdata_services/web_data_service_wrapper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h" | 14 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h" |
15 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service .h" | 15 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service .h" |
16 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h" | 16 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h" |
17 #include "components/autofill/core/browser/webdata/autofill_table.h" | 17 #include "components/autofill/core/browser/webdata/autofill_table.h" |
18 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync able_service.h" | 18 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync able_service.h" |
19 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv ice.h" | 19 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv ice.h" |
20 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 20 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
21 #include "components/password_manager/core/browser/webdata/logins_table.h" | 21 #include "components/password_manager/core/browser/webdata/logins_table.h" |
22 #include "components/payments/content/payment_manifest_section_table.h" | |
22 #include "components/search_engines/keyword_table.h" | 23 #include "components/search_engines/keyword_table.h" |
23 #include "components/search_engines/keyword_web_data_service.h" | 24 #include "components/search_engines/keyword_web_data_service.h" |
24 #include "components/signin/core/browser/webdata/token_service_table.h" | 25 #include "components/signin/core/browser/webdata/token_service_table.h" |
25 #include "components/signin/core/browser/webdata/token_web_data.h" | 26 #include "components/signin/core/browser/webdata/token_web_data.h" |
26 #include "components/sync/driver/sync_driver_switches.h" | 27 #include "components/sync/driver/sync_driver_switches.h" |
27 #include "components/webdata/common/web_database_service.h" | 28 #include "components/webdata/common/web_database_service.h" |
28 #include "components/webdata/common/webdata_constants.h" | 29 #include "components/webdata/common/webdata_constants.h" |
29 | 30 |
30 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
31 #include "components/password_manager/core/browser/webdata/password_web_data_ser vice_win.h" | 32 #include "components/password_manager/core/browser/webdata/password_web_data_ser vice_win.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 | 87 |
87 // All tables objects that participate in managing the database must | 88 // All tables objects that participate in managing the database must |
88 // be added here. | 89 // be added here. |
89 web_database_->AddTable(base::WrapUnique(new autofill::AutofillTable)); | 90 web_database_->AddTable(base::WrapUnique(new autofill::AutofillTable)); |
90 web_database_->AddTable(base::WrapUnique(new KeywordTable)); | 91 web_database_->AddTable(base::WrapUnique(new KeywordTable)); |
91 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password | 92 // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password |
92 // access, but for now, we still create it on all platforms since it deletes | 93 // access, but for now, we still create it on all platforms since it deletes |
93 // the old logins table. We can remove this after a while, e.g. in M22 or so. | 94 // the old logins table. We can remove this after a while, e.g. in M22 or so. |
94 web_database_->AddTable(base::WrapUnique(new LoginsTable)); | 95 web_database_->AddTable(base::WrapUnique(new LoginsTable)); |
95 web_database_->AddTable(base::WrapUnique(new TokenServiceTable)); | 96 web_database_->AddTable(base::WrapUnique(new TokenServiceTable)); |
97 web_database_->AddTable( | |
98 base::WrapUnique(new payments::PaymentManifestSectionTable)); | |
please use gerrit instead
2017/04/05 20:33:31
base::MakeUnique.
gogerald1
2017/04/05 23:38:49
Done.
| |
96 web_database_->LoadDatabase(); | 99 web_database_->LoadDatabase(); |
97 | 100 |
98 autofill_web_data_ = new autofill::AutofillWebDataService( | 101 autofill_web_data_ = new autofill::AutofillWebDataService( |
99 web_database_, ui_thread, db_thread, | 102 web_database_, ui_thread, db_thread, |
100 base::Bind(show_error_callback, ERROR_LOADING_AUTOFILL)); | 103 base::Bind(show_error_callback, ERROR_LOADING_AUTOFILL)); |
101 autofill_web_data_->Init(); | 104 autofill_web_data_->Init(); |
102 | 105 |
103 keyword_web_data_ = new KeywordWebDataService( | 106 keyword_web_data_ = new KeywordWebDataService( |
104 web_database_, ui_thread, | 107 web_database_, ui_thread, |
105 base::Bind(show_error_callback, ERROR_LOADING_KEYWORD)); | 108 base::Bind(show_error_callback, ERROR_LOADING_KEYWORD)); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() { | 153 scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() { |
151 return token_web_data_.get(); | 154 return token_web_data_.get(); |
152 } | 155 } |
153 | 156 |
154 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
155 scoped_refptr<PasswordWebDataService> | 158 scoped_refptr<PasswordWebDataService> |
156 WebDataServiceWrapper::GetPasswordWebData() { | 159 WebDataServiceWrapper::GetPasswordWebData() { |
157 return password_web_data_.get(); | 160 return password_web_data_.get(); |
158 } | 161 } |
159 #endif | 162 #endif |
OLD | NEW |