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

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

Issue 2779283002: [Web Payments] Implement the CVC Unmask dialog. (Closed)
Patch Set: 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 72544464f1ad755fad9826034499e9cde167a7d4..190440f3d456b90866939fd4612d49f931ddbbf6 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"
@@ -47,4 +49,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 =
+ 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