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

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: renamed to autofill_assistant 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..7e9f7c915e2f093e5de2351d248d2ef277331535 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)
+ auto infobar_delegate =
+ base::MakeUnique<AutofillCreditCardFillingInfoBarDelegateMobile>(
+ card, callback);
+ auto* raw_delegate = infobar_delegate.get();
+ std::unique_ptr<infobars::InfoBar> infobar(
+ base::MakeUnique<AutofillCreditCardFillingInfoBar>(
+ std::move(infobar_delegate)));
+ if (infobar) {
+ infobars::InfoBar* added_infobar =
+ InfoBarService::FromWebContents(web_contents())
+ ->AddInfoBar(std::move(infobar));
+ if (added_infobar)
+ raw_delegate->set_was_shown();
Peter Kasting 2016/08/04 00:51:41 Nit: Can just inline if you want: if (InfoBar
Mathieu 2016/08/04 01:31:50 Done, thanks
+ }
+#endif
+}
+
void ChromeAutofillClient::LoadRiskData(
const base::Callback<void(const std::string&)>& callback) {
::autofill::LoadRiskData(0, web_contents(), callback);
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.h ('k') | chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698