Chromium Code Reviews| 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..81ae87f9d0c9b85352c7b3d45a8ee6cc20199dec 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" |
| @@ -77,7 +79,8 @@ ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) |
| unmask_controller_( |
| user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()), |
| Profile::FromBrowserContext(web_contents->GetBrowserContext()) |
| - ->IsOffTheRecord()) { |
| + ->IsOffTheRecord()), |
| + weak_ptr_factory_(this) { |
| DCHECK(web_contents); |
| #if !BUILDFLAG(ANDROID_JAVA_UI) |
| @@ -211,6 +214,25 @@ void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( |
| #endif |
| } |
| +void ChromeAutofillClient::ConfirmCreditCardFillAssist( |
| + const CreditCard& card, |
| + const base::Closure& callback) { |
| +#if defined(OS_ANDROID) |
| + AutofillCreditCardFillingInfoBarDelegateMobile::Create( |
|
Evan Stade
2016/08/02 13:46:41
is it possible to avoid adding CreateCreditCardFil
|
| + InfoBarService::FromWebContents(web_contents()), |
| + weak_ptr_factory_.GetWeakPtr(), card, callback); |
| +#endif |
| +} |
| + |
| +#if defined(OS_ANDROID) |
| +std::unique_ptr<infobars::InfoBar> |
| +ChromeAutofillClient::CreateCreditCardFillingInfoBar( |
| + std::unique_ptr<AutofillCreditCardFillingInfoBarDelegateMobile> delegate) { |
| + return base::WrapUnique( |
| + new AutofillCreditCardFillingInfoBar(std::move(delegate))); |
| +} |
| +#endif |
| + |
| void ChromeAutofillClient::LoadRiskData( |
| const base::Callback<void(const std::string&)>& callback) { |
| ::autofill::LoadRiskData(0, web_contents(), callback); |