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

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

Issue 2657473003: Show Physical Web zero-suggest omnibox suggestions after query is deleted (Closed)
Patch Set: require PhysicalWebAfterTyping experiment 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
« no previous file with comments | « no previous file | components/omnibox/browser/physical_web_provider_unittest.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.cc
diff --git a/components/omnibox/browser/physical_web_provider.cc b/components/omnibox/browser/physical_web_provider.cc
index 4159ee1e2d8cf297c9d3679b02f39b0d5be77a97..36aec4699e8afec52f21c061b49527bba18384df 100644
--- a/components/omnibox/browser/physical_web_provider.cc
+++ b/components/omnibox/browser/physical_web_provider.cc
@@ -75,7 +75,10 @@ void PhysicalWebProvider::Start(const AutocompleteInput& input,
return;
}
- if (input.from_omnibox_focus()) {
+ bool input_from_focus = input.from_omnibox_focus();
Mark P 2017/01/25 20:19:47 nit: both const
mattreynolds 2017/01/25 22:01:52 Done.
+ bool empty_input_from_user = !input_from_focus && input.text().empty();
+
+ if (input_from_focus || empty_input_from_user) {
ConstructZeroSuggestMatches(data_source->GetMetadataList());
if (!matches_.empty()) {
@@ -83,7 +86,12 @@ void PhysicalWebProvider::Start(const AutocompleteInput& input,
had_physical_web_suggestions_at_focus_or_later_ = true;
}
- if (!zero_suggest_enabled_) {
+ // Don't show zero-suggest suggestions unless the PhysicalWebZeroSuggest
+ // omnibox experiment parameter is enabled. If the omnibox input is empty
+ // because the user cleared it, also require that PhysicalWebAfterTyping is
+ // enabled.
+ if (!zero_suggest_enabled_ ||
+ (empty_input_from_user && !after_typing_enabled_)) {
matches_.clear();
}
@@ -104,6 +112,8 @@ void PhysicalWebProvider::Start(const AutocompleteInput& input,
had_physical_web_suggestions_at_focus_or_later_ = true;
}
+ // Don't show Physical Web suggestions after the user starts typing unless
+ // the PhysicalWebAfterTyping omnibox experiment parameter is enabled.
if (!after_typing_enabled_) {
matches_.clear();
}
« no previous file with comments | « no previous file | components/omnibox/browser/physical_web_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698