| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/autofill_assistant.h" | 5 #include "components/autofill/core/browser/autofill_assistant.h" |
| 6 | 6 |
| 7 #include "base/containers/adapters.h" | 7 #include "base/containers/adapters.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "components/autofill/core/browser/autofill_experiments.h" | 9 #include "components/autofill/core/browser/autofill_experiments.h" |
| 10 #include "components/autofill/core/browser/autofill_manager.h" | 10 #include "components/autofill/core/browser/autofill_manager.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 void AutofillAssistant::ShowAssistForCreditCard(const CreditCard& card) { | 42 void AutofillAssistant::ShowAssistForCreditCard(const CreditCard& card) { |
| 43 DCHECK(credit_card_form_data_); | 43 DCHECK(credit_card_form_data_); |
| 44 autofill_manager_->client()->ConfirmCreditCardFillAssist( | 44 autofill_manager_->client()->ConfirmCreditCardFillAssist( |
| 45 card, base::Bind(&AutofillAssistant::OnUserDidAcceptCreditCardFill, | 45 card, base::Bind(&AutofillAssistant::OnUserDidAcceptCreditCardFill, |
| 46 weak_ptr_factory_.GetWeakPtr(), card)); | 46 weak_ptr_factory_.GetWeakPtr(), card)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void AutofillAssistant::OnUserDidAcceptCreditCardFill(const CreditCard& card) { | 49 void AutofillAssistant::OnUserDidAcceptCreditCardFill(const CreditCard& card) { |
| 50 // TODO(crbug.com/630656): Trigger CVC dialog flow for card filling. | 50 autofill_manager_->GetOrCreateFullCardRequest()->GetFullCard( |
| 51 card, AutofillClient::UNMASK_FOR_AUTOFILL, |
| 52 weak_ptr_factory_.GetWeakPtr()); |
| 53 } |
| 54 |
| 55 void AutofillAssistant::OnFullCardDetails(const CreditCard& card, |
| 56 const base::string16& cvc) { |
| 51 autofill_manager_->FillCreditCardForm(kNoQueryId, *credit_card_form_data_, | 57 autofill_manager_->FillCreditCardForm(kNoQueryId, *credit_card_form_data_, |
| 52 credit_card_form_data_->fields[0], card, | 58 credit_card_form_data_->fields[0], card, |
| 53 base::string16()); | 59 cvc); |
| 54 } | 60 } |
| 55 | 61 |
| 62 void AutofillAssistant::OnFullCardError() {} |
| 63 |
| 56 } // namespace autofill | 64 } // namespace autofill |
| OLD | NEW |