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

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

Issue 5703002: Add some basic success/failure UMA logging for autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Hopefully compile on Windows Created 10 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/form_structure.cc
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
index 2958df6728282b46ecbdf4755861b7569ce68504..7fa42dd0eb1d941b0a2e9fb4dbe899804d263d88 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -192,11 +192,13 @@ bool FormStructure::EncodeQueryRequest(const ScopedVector<FormStructure>& forms,
}
// static
-void FormStructure::ParseQueryResponse(const std::string& response_xml,
- const std::vector<FormStructure*>& forms,
- UploadRequired* upload_required) {
- autofill_metrics::LogServerQueryMetric(
- autofill_metrics::QUERY_RESPONSE_RECEIVED);
+void FormStructure::ParseQueryResponse(
+ const std::string& response_xml,
+ const std::vector<FormStructure*>& forms,
+ UploadRequired* upload_required,
+ const AutoFillServerQueryMetricLogger& server_query_metric_logger) {
+ server_query_metric_logger.Log(
+ AutoFillServerQueryMetricLogger::QUERY_RESPONSE_RECEIVED);
// Parse the field types from the server response to the query.
std::vector<AutoFillFieldType> field_types;
@@ -206,8 +208,8 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml,
if (!parse_handler.succeeded())
return;
- autofill_metrics::LogServerQueryMetric(
- autofill_metrics::QUERY_RESPONSE_PARSED);
+ server_query_metric_logger.Log(
+ AutoFillServerQueryMetricLogger::QUERY_RESPONSE_PARSED);
bool heuristics_detected_fillable_field = false;
bool query_response_overrode_heuristics = false;
@@ -250,17 +252,20 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml,
form->UpdateAutoFillCount();
}
- autofill_metrics::ServerQueryMetricType metric_type;
+ AutoFillServerQueryMetricLogger::Metric metric;
if (query_response_overrode_heuristics) {
if (heuristics_detected_fillable_field) {
- metric_type = autofill_metrics::QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS;
+ metric = AutoFillServerQueryMetricLogger::
+ QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS;
} else {
- metric_type = autofill_metrics::QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS;
+ metric = AutoFillServerQueryMetricLogger::
+ QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS;
}
} else {
- metric_type = autofill_metrics::QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS;
+ metric = AutoFillServerQueryMetricLogger::
+ QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS;
}
- autofill_metrics::LogServerQueryMetric(metric_type);
+ server_query_metric_logger.Log(metric);
}
std::string FormStructure::FormSignature() const {

Powered by Google App Engine
This is Rietveld 408576698