OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_DE
LEGATE_MOBILE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_DE
LEGATE_MOBILE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" |
| 13 #include "components/autofill/core/browser/autofill_metrics.h" |
| 14 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 15 |
| 16 namespace infobars { |
| 17 class InfoBarManager; |
| 18 } |
| 19 |
| 20 namespace autofill { |
| 21 |
| 22 class CreditCard; |
| 23 |
| 24 // An InfoBarDelegate that enables the user to allow or deny filling credit |
| 25 // card information on a website form. Only used on mobile. |
| 26 class AutofillCreditCardFillingInfoBarDelegateMobile |
| 27 : public ConfirmInfoBarDelegate { |
| 28 public: |
| 29 AutofillCreditCardFillingInfoBarDelegateMobile( |
| 30 const CreditCard& card, |
| 31 const base::Closure& card_filling_callback); |
| 32 ~AutofillCreditCardFillingInfoBarDelegateMobile() override; |
| 33 |
| 34 int issuer_icon_id() const { return issuer_icon_id_; } |
| 35 const base::string16& card_label() const { return card_label_; } |
| 36 const base::string16& card_sub_label() const { return card_sub_label_; } |
| 37 void set_was_shown() { was_shown_ = true; } |
| 38 |
| 39 // ConfirmInfoBarDelegate (publicly exposed): |
| 40 int GetIconId() const override; |
| 41 base::string16 GetMessageText() const override; |
| 42 void InfoBarDismissed() override; |
| 43 bool Accept() override; |
| 44 bool Cancel() override; |
| 45 |
| 46 private: |
| 47 // ConfirmInfoBarDelegate (continued): |
| 48 Type GetInfoBarType() const override; |
| 49 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 50 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 51 |
| 52 void LogUserAction(AutofillMetrics::InfoBarMetric user_action); |
| 53 |
| 54 // The callback after having accepted the infobar; will initiate filling the |
| 55 // credit card information. |
| 56 base::Closure card_filling_callback_; |
| 57 |
| 58 // Did the user ever explicitly accept or dismiss this infobar? |
| 59 bool had_user_interaction_; |
| 60 |
| 61 // Tracks whether the infobar was shown. |
| 62 bool was_shown_; |
| 63 |
| 64 // The resource ID for the icon that identifies the issuer of the card. |
| 65 int issuer_icon_id_; |
| 66 |
| 67 base::string16 card_label_; |
| 68 base::string16 card_sub_label_; |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(AutofillCreditCardFillingInfoBarDelegateMobile); |
| 71 }; |
| 72 |
| 73 } // namespace autofill |
| 74 |
| 75 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR
_DELEGATE_MOBILE_H_ |
OLD | NEW |