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

Unified Diff: components/autofill/core/browser/autofill_metrics.cc

Issue 23537014: rAc: Get rid of dialog type in rAc, there is only one type left now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 months 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: components/autofill/core/browser/autofill_metrics.cc
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc
index cc4a4e77352e73a2ce5a9f6a872e68857867b7c4..98df16d648a07ede8d0e1a7c9d4bc5b07318dc24 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -158,20 +158,6 @@ int GetFieldTypeGroupMetric(const ServerFieldType field_type,
return (group * num_possible_metrics) + metric;
}
-// Returns the histogram prefix to use for reporting metrics for |dialog_type|.
-std::string GetPrefixForDialogType(autofill::DialogType dialog_type) {
- switch (dialog_type) {
- case autofill::DIALOG_TYPE_AUTOCHECKOUT:
- return "Autocheckout";
-
- case autofill::DIALOG_TYPE_REQUEST_AUTOCOMPLETE:
- return "RequestAutocomplete";
- }
-
- NOTREACHED();
- return "UnknownDialogType";
-}
-
std::string WalletApiMetricToString(
AutofillMetrics::WalletApiCallMetric metric) {
switch (metric) {
@@ -331,47 +317,36 @@ void AutofillMetrics::LogCreditCardInfoBarMetric(InfoBarMetric metric) const {
}
void AutofillMetrics::LogDialogDismissalState(
- autofill::DialogType dialog_type,
DialogDismissalState state) const {
- std::string name = GetPrefixForDialogType(dialog_type) + ".DismissalState";
- LogUMAHistogramEnumeration(name, state, NUM_DIALOG_DISMISSAL_STATES);
+ UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.DismissalState",
+ state, NUM_DIALOG_DISMISSAL_STATES);
}
void AutofillMetrics::LogDialogInitialUserState(
- autofill::DialogType dialog_type,
DialogInitialUserStateMetric user_type) const {
- std::string name = GetPrefixForDialogType(dialog_type) + ".InitialUserState";
- LogUMAHistogramEnumeration(
- name, user_type, NUM_DIALOG_INITIAL_USER_STATE_METRICS);
+ UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.InitialUserState",
+ user_type, NUM_DIALOG_INITIAL_USER_STATE_METRICS);
}
void AutofillMetrics::LogDialogLatencyToShow(
- autofill::DialogType dialog_type,
const base::TimeDelta& duration) const {
- std::string name =
- GetPrefixForDialogType(dialog_type) + ".UiLatencyToShow";
- LogUMAHistogramTimes(name, duration);
+ LogUMAHistogramTimes("RequestAutocomplete.UiLatencyToShow", duration);
}
-void AutofillMetrics::LogDialogPopupEvent(autofill::DialogType dialog_type,
- DialogPopupEvent event) const {
- std::string name = GetPrefixForDialogType(dialog_type) + ".PopupInDialog";
- LogUMAHistogramEnumeration(name, event, NUM_DIALOG_POPUP_EVENTS);
+void AutofillMetrics::LogDialogPopupEvent(DialogPopupEvent event) const {
+ UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.PopupInDialog",
+ event, NUM_DIALOG_POPUP_EVENTS);
}
void AutofillMetrics::LogDialogSecurityMetric(
- autofill::DialogType dialog_type,
DialogSecurityMetric metric) const {
- std::string name = GetPrefixForDialogType(dialog_type) + ".Security";
- LogUMAHistogramEnumeration(name, metric, NUM_DIALOG_SECURITY_METRICS);
+ UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.Security",
+ metric, NUM_DIALOG_SECURITY_METRICS);
}
void AutofillMetrics::LogDialogUiDuration(
const base::TimeDelta& duration,
- autofill::DialogType dialog_type,
DialogDismissalAction dismissal_action) const {
- std::string prefix = GetPrefixForDialogType(dialog_type);
-
std::string suffix;
switch (dismissal_action) {
case DIALOG_ACCEPTED:
@@ -383,20 +358,19 @@ void AutofillMetrics::LogDialogUiDuration(
break;
}
- LogUMAHistogramLongTimes(prefix + ".UiDuration", duration);
- LogUMAHistogramLongTimes(prefix + ".UiDuration." + suffix, duration);
+ LogUMAHistogramLongTimes("RequestAutocomplete.UiDuration", duration);
+ LogUMAHistogramLongTimes("RequestAutocomplete.UiDuration." + suffix,
+ duration);
}
-void AutofillMetrics::LogDialogUiEvent(autofill::DialogType dialog_type,
- DialogUiEvent event) const {
- std::string name = GetPrefixForDialogType(dialog_type) + ".UiEvents";
- LogUMAHistogramEnumeration(name, event, NUM_DIALOG_UI_EVENTS);
+void AutofillMetrics::LogDialogUiEvent(DialogUiEvent event) const {
+ UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.UiEvents", event,
+ NUM_DIALOG_UI_EVENTS);
}
-void AutofillMetrics::LogWalletErrorMetric(autofill::DialogType dialog_type,
- WalletErrorMetric metric) const {
- std::string name = GetPrefixForDialogType(dialog_type) + ".WalletErrors";
- LogUMAHistogramEnumeration(name, metric, NUM_WALLET_ERROR_METRICS);
+void AutofillMetrics::LogWalletErrorMetric(WalletErrorMetric metric) const {
+ UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.WalletErrors", metric,
+ NUM_WALLET_ERROR_METRICS);
}
void AutofillMetrics::LogWalletApiCallDuration(
@@ -407,12 +381,9 @@ void AutofillMetrics::LogWalletApiCallDuration(
}
void AutofillMetrics::LogWalletRequiredActionMetric(
- autofill::DialogType dialog_type,
WalletRequiredActionMetric required_action) const {
- std::string name =
- GetPrefixForDialogType(dialog_type) + ".WalletRequiredActions";
- LogUMAHistogramEnumeration(
- name, required_action, NUM_WALLET_REQUIRED_ACTIONS);
+ UMA_HISTOGRAM_ENUMERATION("RequestAutocomplete.WalletRequiredActions",
+ required_action, NUM_WALLET_REQUIRED_ACTIONS);
}
void AutofillMetrics::LogDeveloperEngagementMetric(
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.h ('k') | components/autofill/core/browser/test_autofill_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698