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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 21668003: Implement newly saved card bubble for realz and update generated card bubble to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 5 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/ui/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index 32d1383c2779b1a94df1cd7db5ac565f85d1f0ec..daf2b4f50684480fd64607d1e9eed5cb8d730cfc 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -3447,8 +3447,31 @@ void AutofillDialogControllerImpl::MaybeShowCreditCardBubble() {
return;
if (newly_saved_card_) {
+ scoped_ptr<AutofillProfile> billing_profile;
+
+ SuggestionsMenuModel* billing_model =
+ SuggestionsMenuModelForSection(SECTION_BILLING);
+ std::string item_key = billing_model->GetItemKeyForCheckedItem();
+ if (IsASuggestionItemKey(item_key) &&
+ !IsManuallyEditingSection(SECTION_BILLING)) {
+ // Just snag the currently suggested profile.
+ AutofillProfile* profile = GetManager()->GetProfileByGUID(item_key);
+ billing_profile.reset(new AutofillProfile(*profile));
+ } else {
+ // Scrape the view as the user's entering or updating information.
+ DetailOutputMap outputs;
+ view_->GetUserInput(SECTION_BILLING, &outputs);
+ billing_profile.reset(new AutofillProfile);
+ FillFormGroupFromOutputs(outputs, billing_profile.get());
+ }
+
+ // The bubble also needs the associated email address.
+ billing_profile->SetRawInfo(
+ EMAIL_ADDRESS,
+ GetValueFromSection(SECTION_EMAIL, EMAIL_ADDRESS));
+
AutofillCreditCardBubbleController::ShowNewCardSavedBubble(
- web_contents(), newly_saved_card_->TypeAndLastFourDigits());
+ web_contents(), newly_saved_card_.Pass(), billing_profile.Pass());
return;
}
@@ -3471,7 +3494,7 @@ void AutofillDialogControllerImpl::MaybeShowCreditCardBubble() {
GetBillingInfoFromOutputs(output, &card, NULL, NULL);
backing_last_four = card.TypeAndLastFourDigits();
}
- AutofillCreditCardBubbleController::ShowGeneratedCardUI(
+ AutofillCreditCardBubbleController::ShowGeneratedCardBubble(
web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits());
}

Powered by Google App Engine
This is Rietveld 408576698