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

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

Issue 869003003: Add RealPanWalletClient for handling card unmasking requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: brettw review Created 5 years, 11 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_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index b9123d0674c4f40feaa014629ccaeed59e2d437e..c25c99c6e01fcc127a1184eb13446f2869517845 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -145,6 +145,7 @@ AutofillManager::AutofillManager(
AutofillDownloadManagerState enable_download_manager)
: driver_(driver),
client_(client),
+ real_pan_client_(driver->GetURLRequestContext(), this),
app_locale_(app_locale),
personal_data_(client->GetPersonalDataManager()),
autocomplete_history_manager_(
@@ -681,6 +682,10 @@ void AutofillManager::OnLoadedServerPredictions(
}
void AutofillManager::OnUnmaskResponse(const base::string16& cvc) {
+ // Most of this function is demo code. The real code should look something
+ // like:
+ // real_pan_client_.UnmaskCard(unmasking_card_, cvc);
+
unmasking_cvc_ = cvc;
// TODO(estade): fake verification: assume 123/1234 is the correct cvc.
if (StartsWithASCII(base::UTF16ToASCII(cvc), "123", true)) {
@@ -697,11 +702,21 @@ void AutofillManager::OnUnmaskResponse(const base::string16& cvc) {
}
void AutofillManager::OnUnmaskPromptClosed() {
+ real_pan_client_.CancelRequest();
driver_->RendererShouldClearPreviewedForm();
unmasking_card_ = CreditCard();
unmasking_cvc_.clear();
}
+void AutofillManager::OnDidGetRealPan(const std::string& real_pan) {
+ NOTIMPLEMENTED();
+}
+
+std::string AutofillManager::GetOAuth2Token() {
+ NOTIMPLEMENTED();
+ return "would_I_lie_to_you?";
+}
+
void AutofillManager::OnUnmaskVerificationResult(bool success) {
if (success) {
unmasking_card_.set_record_type(CreditCard::FULL_SERVER_CARD);
@@ -847,6 +862,7 @@ AutofillManager::AutofillManager(AutofillDriver* driver,
PersonalDataManager* personal_data)
: driver_(driver),
client_(client),
+ real_pan_client_(driver->GetURLRequestContext(), this),
app_locale_("en-US"),
personal_data_(personal_data),
autocomplete_history_manager_(
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/wallet/real_pan_wallet_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698