OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_save_card_infobar_delegate_m
obile.h" | 5 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m
obile.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 void AutofillSaveCardInfoBarDelegateMobile::InfoBarDismissed() { | 92 void AutofillSaveCardInfoBarDelegateMobile::InfoBarDismissed() { |
93 LogUserAction(AutofillMetrics::INFOBAR_DENIED); | 93 LogUserAction(AutofillMetrics::INFOBAR_DENIED); |
94 } | 94 } |
95 | 95 |
96 base::string16 AutofillSaveCardInfoBarDelegateMobile::GetButtonLabel( | 96 base::string16 AutofillSaveCardInfoBarDelegateMobile::GetButtonLabel( |
97 InfoBarButton button) const { | 97 InfoBarButton button) const { |
98 return l10n_util::GetStringUTF16(button == BUTTON_OK | 98 return l10n_util::GetStringUTF16(button == BUTTON_OK |
99 ? IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT | 99 ? IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT |
100 : IDS_AUTOFILL_SAVE_CARD_PROMPT_DENY); | 100 : IDS_NO_THANKS); |
101 } | 101 } |
102 | 102 |
103 bool AutofillSaveCardInfoBarDelegateMobile::Accept() { | 103 bool AutofillSaveCardInfoBarDelegateMobile::Accept() { |
104 save_card_callback_.Run(); | 104 save_card_callback_.Run(); |
105 save_card_callback_.Reset(); | 105 save_card_callback_.Reset(); |
106 LogUserAction(AutofillMetrics::INFOBAR_ACCEPTED); | 106 LogUserAction(AutofillMetrics::INFOBAR_ACCEPTED); |
107 return true; | 107 return true; |
108 } | 108 } |
109 | 109 |
110 bool AutofillSaveCardInfoBarDelegateMobile::Cancel() { | 110 bool AutofillSaveCardInfoBarDelegateMobile::Cancel() { |
111 LogUserAction(AutofillMetrics::INFOBAR_DENIED); | 111 LogUserAction(AutofillMetrics::INFOBAR_DENIED); |
112 return true; | 112 return true; |
113 } | 113 } |
114 | 114 |
115 GURL AutofillSaveCardInfoBarDelegateMobile::GetLinkURL() const { | 115 GURL AutofillSaveCardInfoBarDelegateMobile::GetLinkURL() const { |
116 return GURL(kHelpURL); | 116 return GURL(kHelpURL); |
117 } | 117 } |
118 | 118 |
119 void AutofillSaveCardInfoBarDelegateMobile::LogUserAction( | 119 void AutofillSaveCardInfoBarDelegateMobile::LogUserAction( |
120 AutofillMetrics::InfoBarMetric user_action) { | 120 AutofillMetrics::InfoBarMetric user_action) { |
121 DCHECK(!had_user_interaction_); | 121 DCHECK(!had_user_interaction_); |
122 | 122 |
123 AutofillMetrics::LogCreditCardInfoBarMetric(user_action); | 123 AutofillMetrics::LogCreditCardInfoBarMetric(user_action); |
124 had_user_interaction_ = true; | 124 had_user_interaction_ = true; |
125 } | 125 } |
126 | 126 |
127 } // namespace autofill | 127 } // namespace autofill |
OLD | NEW |