summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/metrics')
-rw-r--r--chrome/browser/metrics/metrics_log.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index a664db0..9ff3957 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -933,7 +933,8 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) {
WriteIntAttribute("numterms", num_terms);
WriteIntAttribute("selectedindex", static_cast<int>(log.selected_index));
WriteIntAttribute("completedlength",
- static_cast<int>(log.inline_autocompleted_length));
+ log.inline_autocompleted_length != string16::npos ?
+ static_cast<int>(log.inline_autocompleted_length) : 0);
if (log.elapsed_time_since_user_first_modified_omnibox !=
base::TimeDelta::FromMilliseconds(-1)) {
// Only upload the typing duration if it is set/valid.
@@ -969,7 +970,8 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) {
omnibox_event->set_just_deleted_text(log.just_deleted_text);
omnibox_event->set_num_typed_terms(num_terms);
omnibox_event->set_selected_index(log.selected_index);
- omnibox_event->set_completed_length(log.inline_autocompleted_length);
+ if (log.inline_autocompleted_length != string16::npos)
+ omnibox_event->set_completed_length(log.inline_autocompleted_length);
if (log.elapsed_time_since_user_first_modified_omnibox !=
base::TimeDelta::FromMilliseconds(-1)) {
// Only upload the typing duration if it is set/valid.