OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h" | 5 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "components/autofill/core/browser/autofill_client.h" | 8 #include "components/autofill/core/browser/autofill_client.h" |
9 #include "components/autofill/core/browser/credit_card.h" | 9 #include "components/autofill/core/browser/credit_card.h" |
10 #include "components/autofill/core/browser/personal_data_manager.h" | 10 #include "components/autofill/core/browser/personal_data_manager.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 void AutofillCCInfoBarDelegate::LogUserAction( | 46 void AutofillCCInfoBarDelegate::LogUserAction( |
47 AutofillMetrics::InfoBarMetric user_action) { | 47 AutofillMetrics::InfoBarMetric user_action) { |
48 DCHECK(!had_user_interaction_); | 48 DCHECK(!had_user_interaction_); |
49 | 49 |
50 AutofillMetrics::LogCreditCardInfoBarMetric(user_action); | 50 AutofillMetrics::LogCreditCardInfoBarMetric(user_action); |
51 had_user_interaction_ = true; | 51 had_user_interaction_ = true; |
52 } | 52 } |
53 | 53 |
| 54 infobars::InfoBarDelegate::Type |
| 55 AutofillCCInfoBarDelegate::GetInfoBarType() const { |
| 56 return PAGE_ACTION_TYPE; |
| 57 } |
| 58 |
| 59 int AutofillCCInfoBarDelegate::GetIconID() const { |
| 60 return IDR_INFOBAR_AUTOFILL_CC; |
| 61 } |
| 62 |
54 void AutofillCCInfoBarDelegate::InfoBarDismissed() { | 63 void AutofillCCInfoBarDelegate::InfoBarDismissed() { |
55 LogUserAction(AutofillMetrics::INFOBAR_DENIED); | 64 LogUserAction(AutofillMetrics::INFOBAR_DENIED); |
56 } | 65 } |
57 | 66 |
58 int AutofillCCInfoBarDelegate::GetIconID() const { | |
59 return IDR_INFOBAR_AUTOFILL_CC; | |
60 } | |
61 | |
62 infobars::InfoBarDelegate::Type AutofillCCInfoBarDelegate::GetInfoBarType() | |
63 const { | |
64 return PAGE_ACTION_TYPE; | |
65 } | |
66 | |
67 bool AutofillCCInfoBarDelegate::ShouldExpireInternal( | 67 bool AutofillCCInfoBarDelegate::ShouldExpireInternal( |
68 const NavigationDetails& details) const { | 68 const NavigationDetails& details) const { |
69 // The user has submitted a form, causing the page to navigate elsewhere. We | 69 // The user has submitted a form, causing the page to navigate elsewhere. We |
70 // don't want the infobar to be expired at this point, because the user won't | 70 // don't want the infobar to be expired at this point, because the user won't |
71 // get a chance to answer the question. | 71 // get a chance to answer the question. |
72 return false; | 72 return false; |
73 } | 73 } |
74 | 74 |
75 base::string16 AutofillCCInfoBarDelegate::GetMessageText() const { | 75 base::string16 AutofillCCInfoBarDelegate::GetMessageText() const { |
76 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_INFOBAR_TEXT); | 76 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_INFOBAR_TEXT); |
(...skipping 23 matching lines...) Expand all Loading... |
100 | 100 |
101 bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 101 bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
102 autofill_client_->LinkClicked( | 102 autofill_client_->LinkClicked( |
103 GURL(autofill::kHelpURL), | 103 GURL(autofill::kHelpURL), |
104 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition); | 104 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition); |
105 | 105 |
106 return false; | 106 return false; |
107 } | 107 } |
108 | 108 |
109 } // namespace autofill | 109 } // namespace autofill |
OLD | NEW |