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

Unified Diff: components/omnibox/browser/physical_web_provider.h

Issue 2689803002: Ensure nearby URL count metric is properly initialized (Closed)
Patch Set: add new histogram to detect corner case Created 3 years, 10 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 | components/omnibox/browser/physical_web_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/physical_web_provider.h
diff --git a/components/omnibox/browser/physical_web_provider.h b/components/omnibox/browser/physical_web_provider.h
index cab09c5c98296ab58b1616f2d42abdacdf80101c..3363da4dd15b996f8bf3dbc714001027cf7b5426 100644
--- a/components/omnibox/browser/physical_web_provider.h
+++ b/components/omnibox/browser/physical_web_provider.h
@@ -47,6 +47,10 @@ class PhysicalWebProvider : public AutocompleteProvider {
HistoryURLProvider* history_url_provider);
~PhysicalWebProvider() override;
+ // Called when a new omnibox session is started. For the purposes of this
+ // provider, a session begins when the omnibox is initially focused.
+ void BeginOmniboxSession();
+
// When the user has focused the omnibox but not yet entered any text (i.e.,
// the Zero Suggest case), calling this method adds a separate match item to
// |matches_| for each nearby URL in |metadata_list|, up to the maximum number
@@ -82,6 +86,14 @@ class PhysicalWebProvider : public AutocompleteProvider {
// matches.
size_t nearby_url_count_;
+ // The number of nearby Physical Web URLs when the omnibox input was last
+ // focused.
+ size_t nearby_url_count_at_focus_;
Mark P 2017/02/22 06:25:39 Can you use npos and test for it explicitly rather
mattreynolds 2017/02/22 20:53:55 Sure, done.
+
+ // The nearby URL count is invalid if the omnibox was not focused during the
+ // current omnibox session. Invalid URL counts should not be recorded.
+ bool nearby_url_count_at_focus_valid_;
+
// If true, provide suggestions when the user has focused the omnibox but has
// not typed anything.
bool zero_suggest_enabled_;
« no previous file with comments | « no previous file | components/omnibox/browser/physical_web_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698