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

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

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Remove debugging info. Created 3 years, 8 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.cc
diff --git a/components/omnibox/browser/physical_web_provider.cc b/components/omnibox/browser/physical_web_provider.cc
index ae43be5f143101ae37d6b4652c8ace96c01a404d..f0033f43463bfccd218328add3260264141cbb7a 100644
--- a/components/omnibox/browser/physical_web_provider.cc
+++ b/components/omnibox/browser/physical_web_provider.cc
@@ -4,6 +4,7 @@
#include "components/omnibox/browser/physical_web_provider.h"
+#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
@@ -102,8 +103,13 @@ void PhysicalWebProvider::Start(const AutocompleteInput& input,
// the omnibox causes the current page to reload. If the input field is
// empty, no default match is required.
if (!matches_.empty() && !input.text().empty()) {
- matches_.push_back(VerbatimMatchForURL(
- client_, input, input.current_url(), history_url_provider_, -1));
+ const base::string16 description =
+ (base::FeatureList::IsEnabled(omnibox::kDisplayTitleForCurrentUrl))
+ ? input.current_title()
+ : base::string16();
+ matches_.push_back(VerbatimMatchForURL(client_, input,
+ input.current_url(), description,
+ history_url_provider_, -1));
}
} else {
ConstructQuerySuggestMatches(std::move(metadata_list), input);
« no previous file with comments | « components/omnibox/browser/omnibox_field_trial.cc ('k') | components/omnibox/browser/physical_web_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698