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

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

Issue 2591053002: Show PhysicalWebProvider suggestions with omnibox input (Closed)
Patch Set: enable experiment in unit tests Created 3 years, 11 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
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 f67f0c45d77eb871fb1f7f1af1d173109baa0306..a689a704b04772e40a5f1261b59a20ed56b1b8c8 100644
--- a/components/omnibox/browser/physical_web_provider.h
+++ b/components/omnibox/browser/physical_web_provider.h
@@ -6,6 +6,7 @@
#define COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_
#include "base/macros.h"
+#include "components/bookmarks/browser/titled_url_match.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_provider.h"
@@ -43,11 +44,21 @@ class PhysicalWebProvider : public AutocompleteProvider {
HistoryURLProvider* history_url_provider);
~PhysicalWebProvider() override;
- // Adds a separate match item to |matches_| for each nearby URL in
- // |metadata_list|, up to the maximum number of matches allowed. If the total
- // number of nearby URLs exceeds this limit, one match is used for an overflow
- // item.
- void ConstructMatches(base::ListValue* metadata_list);
+ // 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
+ // of matches allowed. If the total number of nearby URLs exceeds this limit,
+ // one match is used for an overflow item.
+ void ConstructZeroSuggestMatches(
+ std::unique_ptr<base::ListValue> metadata_list);
+
+ // When the user has entered text into the omnibox (i.e., the Query Suggest
+ // case), calling this method adds a separate match item to |matches_| for
+ // each nearby URL in |metadata_list| that matches all of the query terms in
+ // |input|, up to the maximum number of matches allowed.
+ void ConstructQuerySuggestMatches(
+ std::unique_ptr<base::ListValue> metadata_list,
+ const AutocompleteInput& input);
// Adds an overflow match item to |matches_| with a relevance score equal to
// |relevance| and a label indicating there are |additional_url_count| more
@@ -68,6 +79,32 @@ class PhysicalWebProvider : public AutocompleteProvider {
// matches.
size_t nearby_url_count_;
+ // If true, provide suggestions when the user has focused the omnibox but has
+ // not typed anything.
+ bool zero_suggest_enabled_;
+
+ // If true, provide suggestions when the user has entered a query into the
+ // omnibox.
+ bool after_typing_enabled_;
+
+ // The base relevance score for Physical Web URL suggestions when the user has
+ // not typed anything into the omnibox.
+ int zero_suggest_base_relevance_;
+
+ // The base relevance score for Physical Web URL suggestions after the user
+ // has typed a query into the omnibox.
+ int after_typing_base_relevance_;
+
+ // Set to true if at least one suggestion was created the last time the
+ // provider was started, even if the suggestion could not be displayed due to
+ // a field trial.
+ bool had_physical_web_suggestions_;
+
+ // Set to true if at least one suggestion was created since the last time the
+ // omnibox was focused, even if the suggestion could not be displayed due to
+ // a field trial.
+ bool had_physical_web_suggestions_at_focus_or_later_;
+
DISALLOW_COPY_AND_ASSIGN(PhysicalWebProvider);
};
« no previous file with comments | « components/omnibox/browser/physical_web_node.cc ('k') | components/omnibox/browser/physical_web_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698