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

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

Issue 790543002: Revert of 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
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 a44a1b3a51eefbfbf763642e87dd540cf8f4bf58..f2fd9ea8d0e636e17b3b0e6409ad247c578504f4 100644
--- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
+++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
@@ -24,18 +24,21 @@
// static
void AutofillCCInfoBarDelegate::Create(
InfoBarService* infobar_service,
+ const AutofillMetrics* metric_logger,
const base::Closure& save_card_callback) {
- infobar_service->AddInfoBar(
- ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
- new AutofillCCInfoBarDelegate(save_card_callback))));
+ infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(new AutofillCCInfoBarDelegate(
+ metric_logger, save_card_callback))));
}
AutofillCCInfoBarDelegate::AutofillCCInfoBarDelegate(
+ const AutofillMetrics* metric_logger,
const base::Closure& save_card_callback)
: ConfirmInfoBarDelegate(),
+ metric_logger_(metric_logger),
save_card_callback_(save_card_callback),
had_user_interaction_(false) {
- AutofillMetrics::LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_SHOWN);
+ metric_logger->LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_SHOWN);
}
AutofillCCInfoBarDelegate::~AutofillCCInfoBarDelegate() {
@@ -47,7 +50,7 @@
AutofillMetrics::InfoBarMetric user_action) {
DCHECK(!had_user_interaction_);
- AutofillMetrics::LogCreditCardInfoBarMetric(user_action);
+ metric_logger_->LogCreditCardInfoBarMetric(user_action);
had_user_interaction_ = true;
}

Powered by Google App Engine
This is Rietveld 408576698