diff options
-rw-r--r-- | components/autofill/core/browser/autofill_manager.cc | 14 | ||||
-rw-r--r-- | components/autofill/core/browser/autofill_metrics.cc | 6 | ||||
-rw-r--r-- | components/autofill/core/browser/autofill_metrics.h | 12 | ||||
-rw-r--r-- | components/autofill/core/browser/form_structure.h | 2 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 15 |
5 files changed, 46 insertions, 3 deletions
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index 2f7f346..8e0a75d 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc @@ -1389,14 +1389,22 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) { for (std::vector<FormData>::const_iterator iter = forms.begin(); iter != forms.end(); ++iter) { scoped_ptr<FormStructure> form_structure(new FormStructure(*iter)); - if (!form_structure->ShouldBeParsed()) + + if (!form_structure->ShouldBeParsed()) { + if (form_structure->has_password_field()) { + AutofillMetrics::LogPasswordFormQueryVolume( + AutofillMetrics::NEW_PASSWORD_QUERY); + } continue; + } form_structure->DetermineHeuristicTypes(); - if (form_structure->ShouldBeCrowdsourced()) + if (form_structure->ShouldBeCrowdsourced()) { + AutofillMetrics::LogPasswordFormQueryVolume( + AutofillMetrics::CURRENT_QUERY); form_structures_.push_back(form_structure.release()); - else + } else non_queryable_forms.push_back(form_structure.release()); } diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc index 2e79535..ebf5a6d 100644 --- a/components/autofill/core/browser/autofill_metrics.cc +++ b/components/autofill/core/browser/autofill_metrics.cc @@ -606,6 +606,12 @@ void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) { UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); } +void AutofillMetrics::LogPasswordFormQueryVolume( + PasswordFormQueryVolumeMetric metric) { + UMA_HISTOGRAM_ENUMERATION("Autofill.PasswordFormQueryVolume", metric, + NUM_PASSWORD_FORM_QUERY_VOLUME_METRIC); +} + AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card) : is_for_credit_card_(is_for_credit_card), is_server_data_available_(false), diff --git a/components/autofill/core/browser/autofill_metrics.h b/components/autofill/core/browser/autofill_metrics.h index 613d58d..3d67990 100644 --- a/components/autofill/core/browser/autofill_metrics.h +++ b/components/autofill/core/browser/autofill_metrics.h @@ -418,6 +418,14 @@ class AutofillMetrics { NUM_WALLET_REQUIRED_ACTIONS }; + // For measuring the increased load on the Autofill server if the restriction + // on querying for password forms with fewer than 3 fields were omitted. + enum PasswordFormQueryVolumeMetric { + NEW_PASSWORD_QUERY, + CURRENT_QUERY, + NUM_PASSWORD_FORM_QUERY_VOLUME_METRIC, + }; + static void LogCreditCardInfoBarMetric(InfoBarMetric metric); static void LogScanCreditCardPromptMetric(ScanCreditCardPromptMetric metric); @@ -551,6 +559,10 @@ class AutofillMetrics { // form. static void LogAddressSuggestionsCount(size_t num_suggestions); + // Log password form query: current and if one-to-two fields password forms + // were allowed. + static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric); + // Utility to autofill form events in the relevant histograms depending on // the presence of server and/or local data. class FormEventLogger { diff --git a/components/autofill/core/browser/form_structure.h b/components/autofill/core/browser/form_structure.h index 732b607..8e2e7a1 100644 --- a/components/autofill/core/browser/form_structure.h +++ b/components/autofill/core/browser/form_structure.h @@ -179,6 +179,8 @@ class FormStructure { const GURL& source_url() const { return source_url_; } + bool has_password_field() const { return has_password_field_; } + void set_upload_required(UploadRequired required) { upload_required_ = required; } diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 223dc29..a73f350 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -1944,6 +1944,16 @@ Therefore, the affected-histogram name has to have at least one dot in it. </summary> </histogram> +<histogram name="Autofill.PasswordFormQueryVolume" + enum="PasswordFormQueryVolume"> + <owner>dvadym@chromium.org</owner> + <owner>gcasto@chromium.org</owner> + <summary> + Tracks the increased load on the Autofill server if the restriction on + querying for password forms with fewer than 3 fields were omitted. + </summary> +</histogram> + <histogram name="AutoFill.ProfileCount"> <obsolete> Deprecated as of 3/2011, replaced by Autofill.StoredProfileCount. @@ -56726,6 +56736,11 @@ To add a new entry, add it with any value and run test to compute valid value. <int value="6" label="Opened automatically / Auto-signin toast"/> </enum> +<enum name="PasswordFormQueryVolume" type="int"> + <int value="0" label="New password query"/> + <int value="1" label="Current query"/> +</enum> + <enum name="PasswordGenerationEvent" type="int"> <int value="0" label="No sign up form"/> <int value="1" label="Local heuristics found sign up form"/> |