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

Unified Diff: chrome/browser/payments/chrome_payment_request_delegate.cc

Issue 2779283002: [Web Payments] Implement the CVC Unmask dialog. (Closed)
Patch Set: Update AutofillPaymentInstrument's credit_card_ after unmasking. Created 3 years, 9 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: chrome/browser/payments/chrome_payment_request_delegate.cc
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc
index 236cbcafac571a481bce53918da107408935a129..1d8cffad4ae48fb063a339a3cb15343974e9479b 100644
--- a/chrome/browser/payments/chrome_payment_request_delegate.cc
+++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -9,6 +9,8 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_dialogs.h"
+#include "components/autofill/content/browser/content_autofill_driver.h"
+#include "components/autofill/content/browser/content_autofill_driver_factory.h"
#include "components/payments/content/payment_request_dialog.h"
#include "content/public/browser/web_contents.h"
@@ -52,4 +54,20 @@ bool ChromePaymentRequestDelegate::IsIncognito() const {
return profile && profile->GetProfileType() == Profile::INCOGNITO_PROFILE;
}
+void ChromePaymentRequestDelegate::DoFullCardRequest(
+ const autofill::CreditCard& credit_card,
+ base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate>
+ result_delegate) {
+ autofill::ContentAutofillDriverFactory* factory =
Mathieu 2017/03/30 14:37:32 I don't like this dependence on the AutofillManage
+ autofill::ContentAutofillDriverFactory::FromWebContents(web_contents_);
+ autofill::ContentAutofillDriver* driver =
+ factory->DriverForFrame(web_contents_->GetMainFrame());
+ autofill::payments::FullCardRequest* request =
+ driver->autofill_manager()->GetOrCreateFullCardRequest();
+
+ request->GetFullCard(
+ credit_card, autofill::AutofillClient::UNMASK_FOR_PAYMENT_REQUEST,
+ result_delegate, dialog_->GetFullCardRequestUIDelegate());
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698