| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 const AutofillMetrics* metric_logger, | 35 const AutofillMetrics* metric_logger, |
| 36 const base::Closure& save_card_callback) { | 36 const base::Closure& save_card_callback) { |
| 37 return scoped_ptr<ConfirmInfoBarDelegate>( | 37 return scoped_ptr<ConfirmInfoBarDelegate>( |
| 38 new AutofillCCInfoBarDelegate(metric_logger, save_card_callback)); | 38 new AutofillCCInfoBarDelegate(metric_logger, save_card_callback)); |
| 39 } | 39 } |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 AutofillCCInfoBarDelegate(const AutofillMetrics* metric_logger, | 43 AutofillCCInfoBarDelegate(const AutofillMetrics* metric_logger, |
| 44 const base::Closure& save_card_callback); | 44 const base::Closure& save_card_callback); |
| 45 virtual ~AutofillCCInfoBarDelegate(); | 45 ~AutofillCCInfoBarDelegate() override; |
| 46 | 46 |
| 47 void LogUserAction(AutofillMetrics::InfoBarMetric user_action); | 47 void LogUserAction(AutofillMetrics::InfoBarMetric user_action); |
| 48 | 48 |
| 49 // ConfirmInfoBarDelegate: | 49 // ConfirmInfoBarDelegate: |
| 50 virtual void InfoBarDismissed() override; | 50 void InfoBarDismissed() override; |
| 51 virtual int GetIconID() const override; | 51 int GetIconID() const override; |
| 52 virtual Type GetInfoBarType() const override; | 52 Type GetInfoBarType() const override; |
| 53 virtual bool ShouldExpireInternal( | 53 bool ShouldExpireInternal(const NavigationDetails& details) const override; |
| 54 const NavigationDetails& details) const override; | 54 base::string16 GetMessageText() const override; |
| 55 virtual base::string16 GetMessageText() const override; | 55 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 56 virtual base::string16 GetButtonLabel(InfoBarButton button) const override; | 56 bool Accept() override; |
| 57 virtual bool Accept() override; | 57 bool Cancel() override; |
| 58 virtual bool Cancel() override; | 58 base::string16 GetLinkText() const override; |
| 59 virtual base::string16 GetLinkText() const override; | 59 bool LinkClicked(WindowOpenDisposition disposition) override; |
| 60 virtual bool LinkClicked(WindowOpenDisposition disposition) override; | |
| 61 | 60 |
| 62 // For logging UMA metrics. | 61 // For logging UMA metrics. |
| 63 // Weak reference. Owned by the AutofillManager that initiated this infobar. | 62 // Weak reference. Owned by the AutofillManager that initiated this infobar. |
| 64 const AutofillMetrics* metric_logger_; | 63 const AutofillMetrics* metric_logger_; |
| 65 | 64 |
| 66 // The callback to save credit card if the user accepts the infobar. | 65 // The callback to save credit card if the user accepts the infobar. |
| 67 base::Closure save_card_callback_; | 66 base::Closure save_card_callback_; |
| 68 | 67 |
| 69 // Did the user ever explicitly accept or dismiss this infobar? | 68 // Did the user ever explicitly accept or dismiss this infobar? |
| 70 bool had_user_interaction_; | 69 bool had_user_interaction_; |
| 71 | 70 |
| 72 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardInfoBar); | 71 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardInfoBar); |
| 73 | 72 |
| 74 DISALLOW_COPY_AND_ASSIGN(AutofillCCInfoBarDelegate); | 73 DISALLOW_COPY_AND_ASSIGN(AutofillCCInfoBarDelegate); |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 } // namespace autofill | 76 } // namespace autofill |
| 78 | 77 |
| 79 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ | 78 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ |
| OLD | NEW |