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

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

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Include description for other providers. 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/clipboard_url_provider.cc
diff --git a/components/omnibox/browser/clipboard_url_provider.cc b/components/omnibox/browser/clipboard_url_provider.cc
index 27babb71d130dcf80aef7b851c515011c36b5d78..ad24205047f98721544180d8cc7443ee79cbafdf 100644
--- a/components/omnibox/browser/clipboard_url_provider.cc
+++ b/components/omnibox/browser/clipboard_url_provider.cc
@@ -4,6 +4,7 @@
#include "components/omnibox/browser/clipboard_url_provider.h"
+#include "base/feature_list.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
@@ -47,8 +48,13 @@ void ClipboardURLProvider::Start(const AutocompleteInput& input,
// If the omnibox is not empty, add a default match.
// This match will be opened when the user presses "Enter".
if (!input.text().empty()) {
- AutocompleteMatch verbatim_match = VerbatimMatchForURL(
- client_, input, input.current_url(), history_url_provider_, -1);
+ const base::string16 description =
+ (base::FeatureList::IsEnabled(omnibox::kDisplayTitleForCurrentUrl))
+ ? input.current_title()
+ : base::string16();
+ AutocompleteMatch verbatim_match =
+ VerbatimMatchForURL(client_, input, input.current_url(), description,
+ history_url_provider_, -1);
matches_.push_back(verbatim_match);
}
UMA_HISTOGRAM_BOOLEAN("Omnibox.ClipboardSuggestionShownWithCurrentURL",

Powered by Google App Engine
This is Rietveld 408576698