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

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

Issue 910043002: Add checkbox to card unmasking prompt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix dbg compile Created 5 years, 10 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 f771a61f4f08c811a8613a4d197063a3a7181a80..25aa886bbfe17afd4bda0c6c2e1e144022148034 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -187,6 +187,11 @@ void AutofillManager::RegisterProfilePrefs(
prefs::kAutofillWalletImportEnabled,
true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ // This choice is made on a per-device basis, so it's not syncable.
+ registry->RegisterBooleanPref(
+ prefs::kAutofillWalletImportStorageCheckboxState,
+ true,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if defined(OS_MACOSX)
registry->RegisterBooleanPref(
prefs::kAutofillAuxiliaryProfilesEnabled,
@@ -716,7 +721,7 @@ void AutofillManager::OnLoadedServerPredictions(
}
void AutofillManager::OnUnmaskResponse(const UnmaskResponse& response) {
- unmasking_cvc_ = response.cvc;
+ unmask_response_ = response;
// TODO(estade): use month/year.
real_pan_client_.UnmaskCard(unmasking_card_, base::UTF16ToASCII(response.cvc),
response.risk_data);
@@ -726,7 +731,7 @@ void AutofillManager::OnUnmaskPromptClosed() {
real_pan_client_.CancelRequest();
driver_->RendererShouldClearPreviewedForm();
unmasking_card_ = CreditCard();
- unmasking_cvc_.clear();
+ unmask_response_ = UnmaskResponse();
}
IdentityProvider* AutofillManager::GetIdentityProvider() {
@@ -737,7 +742,9 @@ void AutofillManager::OnDidGetRealPan(const std::string& real_pan) {
if (!real_pan.empty()) {
unmasking_card_.set_record_type(CreditCard::FULL_SERVER_CARD);
unmasking_card_.SetNumber(base::UTF8ToUTF16(real_pan));
- personal_data_->UpdateServerCreditCard(unmasking_card_);
+ if (unmask_response_.should_store_pan)
+ personal_data_->UpdateServerCreditCard(unmasking_card_);
+
FillCreditCardForm(unmasking_query_id_, unmasking_form_, unmasking_field_,
unmasking_card_);
}
@@ -1065,10 +1072,10 @@ void AutofillManager::FillOrPreviewDataModelForm(
if (is_credit_card &&
cached_field->Type().GetStorableType() ==
CREDIT_CARD_VERIFICATION_CODE) {
- // If this is |unmasking_card_|, |unmasking_cvc_| should be non-empty
- // and vice versa.
- DCHECK_EQ(&unmasking_card_ == data_model, !unmasking_cvc_.empty());
- value = unmasking_cvc_;
+ // If this is |unmasking_card_|, |unmask_response_,cvc| should be
+ // non-empty and vice versa.
+ value = unmask_response_.cvc;
+ DCHECK_EQ(&unmasking_card_ == data_model, value.empty());
}
// Must match ForEachMatchingFormField() in form_autofill_util.cc.
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/card_unmask_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698