Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3248)

Unified Diff: chrome/browser/autofill/autofill_cc_infobar_delegate.cc

Issue 780423002: Don't deref stale AutofillMetrics pointer in AutofillCCInfoBarDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/autofill_cc_infobar_delegate.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_cc_infobar_delegate.cc
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
index f2fd9ea8d0e636e17b3b0e6409ad247c578504f4..dfcc764cb31e6353a44c72d62c9747175721317f 100644
--- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
+++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
@@ -36,22 +36,15 @@ AutofillCCInfoBarDelegate::AutofillCCInfoBarDelegate(
const base::Closure& save_card_callback)
: ConfirmInfoBarDelegate(),
metric_logger_(metric_logger),
- save_card_callback_(save_card_callback),
- had_user_interaction_(false) {
+ save_card_callback_(save_card_callback) {
metric_logger->LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_SHOWN);
}
AutofillCCInfoBarDelegate::~AutofillCCInfoBarDelegate() {
- if (!had_user_interaction_)
- LogUserAction(AutofillMetrics::INFOBAR_IGNORED);
}
void AutofillCCInfoBarDelegate::LogUserAction(
AutofillMetrics::InfoBarMetric user_action) {
- DCHECK(!had_user_interaction_);
-
- metric_logger_->LogCreditCardInfoBarMetric(user_action);
Ilya Sherman 2014/12/05 22:58:54 Rather than breaking the metrics, let's just make
Evan Stade 2014/12/05 23:42:47 Done. "Break" is a strong word. I'd instead say "
- had_user_interaction_ = true;
}
void AutofillCCInfoBarDelegate::InfoBarDismissed() {
@@ -87,13 +80,12 @@ base::string16 AutofillCCInfoBarDelegate::GetButtonLabel(
bool AutofillCCInfoBarDelegate::Accept() {
save_card_callback_.Run();
- save_card_callback_.Reset();
- LogUserAction(AutofillMetrics::INFOBAR_ACCEPTED);
+ metric_logger_->LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_ACCEPTED);
return true;
}
bool AutofillCCInfoBarDelegate::Cancel() {
- LogUserAction(AutofillMetrics::INFOBAR_DENIED);
+ metric_logger_->LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_DENIED);
return true;
}
« no previous file with comments | « chrome/browser/autofill/autofill_cc_infobar_delegate.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698