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(bool was_shown) { was_shown_ = was_shown; } | |
Peter Kasting
2016/08/03 02:25:40
Nit: It makes no sense to support set_was_shown(fa
Mathieu
2016/08/03 18:34:44
Done.
| |
38 | |
39 // ConfirmInfoBarDelegate (publicly exposed): | |
40 int GetIconId() const override; | |
41 base::string16 GetMessageText() const override; | |
42 | |
43 protected: | |
Peter Kasting
2016/08/03 02:25:40
Nit: It looks like you only access about half of t
Mathieu
2016/08/03 18:34:44
Done.
| |
44 // ConfirmInfoBarDelegate (continued): | |
45 Type GetInfoBarType() const override; | |
46 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | |
47 void InfoBarDismissed() override; | |
48 base::string16 GetButtonLabel(InfoBarButton button) const override; | |
49 bool Accept() override; | |
50 bool Cancel() override; | |
51 | |
52 private: | |
53 void LogUserAction(AutofillMetrics::InfoBarMetric user_action); | |
54 | |
55 // The callback after having accepted the infobar; will initiate filling the | |
56 // credit card information. | |
57 base::Closure card_filling_callback_; | |
58 | |
59 // Did the user ever explicitly accept or dismiss this infobar? | |
60 bool had_user_interaction_; | |
61 | |
62 // Tracks whether the infobar was shown. | |
63 bool was_shown_; | |
64 | |
65 // The resource ID for the icon that identifies the issuer of the card. | |
66 int issuer_icon_id_; | |
67 | |
68 base::string16 card_label_; | |
69 base::string16 card_sub_label_; | |
70 | |
71 DISALLOW_COPY_AND_ASSIGN(AutofillCreditCardFillingInfoBarDelegateMobile); | |
72 }; | |
73 | |
74 } // namespace autofill | |
75 | |
76 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR _DELEGATE_MOBILE_H_ | |
OLD | NEW |