| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill/core/browser/webdata/autofill_webdata_service.h" | 5 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 WebDataServiceBase::Handle AutofillWebDataService::GetServerCreditCards( | 177 WebDataServiceBase::Handle AutofillWebDataService::GetServerCreditCards( |
| 178 WebDataServiceConsumer* consumer) { | 178 WebDataServiceConsumer* consumer) { |
| 179 return wdbs_->ScheduleDBTaskWithResult(FROM_HERE, | 179 return wdbs_->ScheduleDBTaskWithResult(FROM_HERE, |
| 180 Bind(&AutofillWebDataBackendImpl::GetServerCreditCards, | 180 Bind(&AutofillWebDataBackendImpl::GetServerCreditCards, |
| 181 autofill_backend_), | 181 autofill_backend_), |
| 182 consumer); | 182 consumer); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void AutofillWebDataService::UnmaskServerCreditCard( | 185 void AutofillWebDataService::UnmaskServerCreditCard( |
| 186 const std::string& id, | 186 const CreditCard& credit_card, |
| 187 const base::string16& full_number) { | 187 const base::string16& full_number) { |
| 188 wdbs_->ScheduleDBTask( | 188 wdbs_->ScheduleDBTask( |
| 189 FROM_HERE, | 189 FROM_HERE, |
| 190 Bind(&AutofillWebDataBackendImpl::UnmaskServerCreditCard, | 190 Bind(&AutofillWebDataBackendImpl::UnmaskServerCreditCard, |
| 191 autofill_backend_, id, full_number)); | 191 autofill_backend_, credit_card, full_number)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void AutofillWebDataService::MaskServerCreditCard(const std::string& id) { | 194 void AutofillWebDataService::MaskServerCreditCard(const std::string& id) { |
| 195 wdbs_->ScheduleDBTask( | 195 wdbs_->ScheduleDBTask( |
| 196 FROM_HERE, | 196 FROM_HERE, |
| 197 Bind(&AutofillWebDataBackendImpl::MaskServerCreditCard, | 197 Bind(&AutofillWebDataBackendImpl::MaskServerCreditCard, |
| 198 autofill_backend_, id)); | 198 autofill_backend_, id)); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void AutofillWebDataService::ClearAllServerData() { | 201 void AutofillWebDataService::ClearAllServerData() { |
| 202 wdbs_->ScheduleDBTask( | 202 wdbs_->ScheduleDBTask( |
| 203 FROM_HERE, | 203 FROM_HERE, |
| 204 Bind(&AutofillWebDataBackendImpl::ClearAllServerData, | 204 Bind(&AutofillWebDataBackendImpl::ClearAllServerData, |
| 205 autofill_backend_)); | 205 autofill_backend_)); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void AutofillWebDataService::UpdateUnmaskedCardUsageStats( | 208 void AutofillWebDataService::UpdateServerCardUsageStats( |
| 209 const CreditCard& credit_card) { | 209 const CreditCard& credit_card) { |
| 210 wdbs_->ScheduleDBTask( | 210 wdbs_->ScheduleDBTask( |
| 211 FROM_HERE, | 211 FROM_HERE, |
| 212 Bind(&AutofillWebDataBackendImpl::UpdateUnmaskedCardUsageStats, | 212 Bind(&AutofillWebDataBackendImpl::UpdateServerCardUsageStats, |
| 213 autofill_backend_, credit_card)); | 213 autofill_backend_, credit_card)); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void AutofillWebDataService::UpdateServerAddressUsageStats( |
| 217 const AutofillProfile& profile) { |
| 218 wdbs_->ScheduleDBTask( |
| 219 FROM_HERE, |
| 220 Bind(&AutofillWebDataBackendImpl::UpdateServerAddressUsageStats, |
| 221 autofill_backend_, profile)); |
| 222 } |
| 223 |
| 216 void AutofillWebDataService::RemoveAutofillDataModifiedBetween( | 224 void AutofillWebDataService::RemoveAutofillDataModifiedBetween( |
| 217 const Time& delete_begin, | 225 const Time& delete_begin, |
| 218 const Time& delete_end) { | 226 const Time& delete_end) { |
| 219 wdbs_->ScheduleDBTask( | 227 wdbs_->ScheduleDBTask( |
| 220 FROM_HERE, | 228 FROM_HERE, |
| 221 Bind(&AutofillWebDataBackendImpl::RemoveAutofillDataModifiedBetween, | 229 Bind(&AutofillWebDataBackendImpl::RemoveAutofillDataModifiedBetween, |
| 222 autofill_backend_, delete_begin, delete_end)); | 230 autofill_backend_, delete_begin, delete_end)); |
| 223 } | 231 } |
| 224 | 232 |
| 225 void AutofillWebDataService::RemoveOriginURLsModifiedBetween( | 233 void AutofillWebDataService::RemoveOriginURLsModifiedBetween( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 278 } |
| 271 | 279 |
| 272 void AutofillWebDataService::NotifyAutofillMultipleChangedOnUIThread() { | 280 void AutofillWebDataService::NotifyAutofillMultipleChangedOnUIThread() { |
| 273 DCHECK(ui_thread_->BelongsToCurrentThread()); | 281 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 274 FOR_EACH_OBSERVER(AutofillWebDataServiceObserverOnUIThread, | 282 FOR_EACH_OBSERVER(AutofillWebDataServiceObserverOnUIThread, |
| 275 ui_observer_list_, | 283 ui_observer_list_, |
| 276 AutofillMultipleChanged()); | 284 AutofillMultipleChanged()); |
| 277 } | 285 } |
| 278 | 286 |
| 279 } // namespace autofill | 287 } // namespace autofill |
| OLD | NEW |