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

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

Issue 2945563003: AutofillSaveCardInfoBar on mobile should not appear when legal messages don't parse correctly (Closed)
Patch Set: Code review changes Created 3 years, 6 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/chrome_autofill_client.cc
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc
index ddeed1a06a1862418cc614374b1972d63873e2a4..93c22f4efcdfd8e8b35585eafc0d324c21d71eaf 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -206,10 +206,15 @@ void ChromeAutofillClient::ConfirmSaveCreditCardToCloud(
bool should_cvc_be_requested,
const base::Closure& callback) {
#if defined(OS_ANDROID)
- InfoBarService::FromWebContents(web_contents())
- ->AddInfoBar(CreateSaveCardInfoBarMobile(
+ std::unique_ptr<AutofillSaveCardInfoBarDelegateMobile>
+ save_card_info_bar_delegate_mobile =
base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>(
- true, card, std::move(legal_message), callback, GetPrefs())));
+ true, card, std::move(legal_message), callback, GetPrefs());
+ if (save_card_info_bar_delegate_mobile->LegalMessagesParsedSuccessfully()) {
+ InfoBarService::FromWebContents(web_contents())
+ ->AddInfoBar(CreateSaveCardInfoBarMobile(
+ std::move(save_card_info_bar_delegate_mobile)));
+ }
#else
// Do lazy initialization of SaveCardBubbleControllerImpl.
autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents());

Powered by Google App Engine
This is Rietveld 408576698