Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: components/autofill/core/browser/autofill_assistant.cc

Issue 2254353002: Prompt for CVC in credit card assist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better callback names Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_assistant.cc
diff --git a/components/autofill/core/browser/autofill_assistant.cc b/components/autofill/core/browser/autofill_assistant.cc
index dc4196a3e8207419c807195d2a8ead2fbf5a20fd..b7f00b5a30c771fef84c59c48faae03623e0dbe9 100644
--- a/components/autofill/core/browser/autofill_assistant.cc
+++ b/components/autofill/core/browser/autofill_assistant.cc
@@ -27,8 +27,7 @@ void AutofillAssistant::Reset() {
bool AutofillAssistant::CanShowCreditCardAssist(
const std::vector<FormStructure*>& form_structures) {
- if (form_structures.empty() ||
- credit_card_form_data_ != nullptr ||
+ if (form_structures.empty() || credit_card_form_data_ != nullptr ||
!IsAutofillCreditCardAssistEnabled() ||
!autofill_manager_->client()->IsContextSecure(
form_structures.front()->source_url())) {
@@ -52,10 +51,18 @@ void AutofillAssistant::ShowAssistForCreditCard(const CreditCard& card) {
}
void AutofillAssistant::OnUserDidAcceptCreditCardFill(const CreditCard& card) {
- // TODO(crbug.com/630656): Trigger CVC dialog flow for card filling.
+ autofill_manager_->GetOrCreateFullCardRequest()->GetFullCard(
+ card, AutofillClient::UNMASK_FOR_AUTOFILL,
+ weak_ptr_factory_.GetWeakPtr());
+}
+
+void AutofillAssistant::OnFullCardRequestSucceeded(const CreditCard& card,
+ const base::string16& cvc) {
autofill_manager_->FillCreditCardForm(kNoQueryId, *credit_card_form_data_,
credit_card_form_data_->fields[0], card,
- base::string16());
+ cvc);
}
+void AutofillAssistant::OnFullCardRequestFailed() {}
+
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autofill_assistant.h ('k') | components/autofill/core/browser/autofill_assistant_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698