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

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

Issue 2026353002: [Autofill] Credit Card Assist Infobar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed CreateCreditCardFillingInfoBar from interface Created 4 years, 4 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 e9d87562a8b12e079bc893994071e8c0457f3528..e0f16a5dfde51308a15a67eb57fde91478fc3f3d 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/autofill/risk_util.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -62,6 +61,9 @@
#if defined(OS_ANDROID)
#include "base/android/context_utils.h"
#include "chrome/browser/android/signin/signin_promo_util_android.h"
+#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/browser/ui/android/infobars/autofill_credit_card_filling_infobar.h"
+#include "components/autofill/core/browser/autofill_credit_card_filling_infobar_delegate_mobile.h"
#include "components/autofill/core/browser/autofill_save_card_infobar_delegate_mobile.h"
#include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h"
#include "components/infobars/core/infobar.h"
@@ -211,6 +213,27 @@ void ChromeAutofillClient::ConfirmSaveCreditCardToCloud(
#endif
}
+void ChromeAutofillClient::ConfirmCreditCardFillAssist(
+ const CreditCard& card,
+ const base::Closure& callback) {
+#if defined(OS_ANDROID)
Peter Kasting 2016/08/03 02:25:40 If it's really true that desktop is "never going t
Mathieu 2016/08/03 18:34:44 I would like to keep the delegate inside component
+ std::unique_ptr<infobars::InfoBar> infobar(
+ base::WrapUnique(new AutofillCreditCardFillingInfoBar(
Peter Kasting 2016/08/03 02:25:40 Nit: Use MakeUnique in newly-written code (WrapUni
Mathieu 2016/08/03 18:34:44 Done.
+ base::WrapUnique(new AutofillCreditCardFillingInfoBarDelegateMobile(
+ card, callback)))));
+ if (infobar) {
+ infobars::InfoBar* added_infobar =
+ InfoBarService::FromWebContents(web_contents())
+ ->AddInfoBar(std::move(infobar));
+ if (added_infobar) {
+ static_cast<AutofillCreditCardFillingInfoBarDelegateMobile*>(
Peter Kasting 2016/08/03 02:25:40 Nit: Just save this raw pointer off when you first
Mathieu 2016/08/03 18:34:44 Done.
+ added_infobar->delegate())
+ ->set_was_shown(true);
+ }
+ }
+#endif
+}
+
void ChromeAutofillClient::LoadRiskData(
const base::Callback<void(const std::string&)>& callback) {
::autofill::LoadRiskData(0, web_contents(), callback);

Powered by Google App Engine
This is Rietveld 408576698