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

Unified Diff: components/omnibox/browser/omnibox_edit_model.cc

Issue 2245443002: Omnibox: Remove Overly-Aggressive DCHECK (focus must occur before open) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/omnibox_edit_model.cc
diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc
index 4d6b3c5d60658bae4377dde199983725ead50f03..5e9549992251d3eae3a582f6b3f0d0423a71b7c4 100644
--- a/components/omnibox/browser/omnibox_edit_model.cc
+++ b/components/omnibox/browser/omnibox_edit_model.cc
@@ -80,7 +80,8 @@ const char kFocusToEditTimeHistogram[] = "Omnibox.FocusToEditTime";
// Histogram name which counts the number of milliseconds a user takes
// between focusing and opening an omnibox match.
-const char kFocusToOpenTimeHistogram[] = "Omnibox.FocusToOpenTimeAnyPopupState";
+const char kFocusToOpenTimeHistogram[] =
+ "Omnibox.FocusToOpenTimeAnyPopupState2";
// Split the percentage match histograms into buckets based on the width of the
// omnibox.
@@ -731,9 +732,11 @@ void OmniboxEditModel::OpenMatch(AutocompleteMatch match,
client_->OnURLOpenedFromOmnibox(&log);
OmniboxEventGlobalTracker::GetInstance()->OnURLOpened(&log);
LOCAL_HISTOGRAM_BOOLEAN("Omnibox.EventCount", true);
- DCHECK(!last_omnibox_focus_.is_null())
- << "An omnibox focus should have occurred before opening a match.";
- UMA_HISTOGRAM_TIMES(kFocusToOpenTimeHistogram, now - last_omnibox_focus_);
+ if (!last_omnibox_focus_.is_null()) {
+ // Only record focus to open time when a focus actually happened (as
+ // opposed to, say, dragging a link onto the omnibox).
+ UMA_HISTOGRAM_TIMES(kFocusToOpenTimeHistogram, now - last_omnibox_focus_);
+ }
TemplateURLService* service = client_->GetTemplateURLService();
TemplateURL* template_url = match.GetTemplateURL(service, false);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698