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

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

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Fix comments and add title in verbatim_match.cc 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/verbatim_match.cc
diff --git a/components/omnibox/browser/verbatim_match.cc b/components/omnibox/browser/verbatim_match.cc
index 381ba3d2ffa7b7bdbdee3e63dfc3a7fb3d1aa149..5c214aff6de9239a6ace9cb217a26407429c2b3b 100644
--- a/components/omnibox/browser/verbatim_match.cc
+++ b/components/omnibox/browser/verbatim_match.cc
@@ -4,6 +4,7 @@
#include "components/omnibox/browser/verbatim_match.h"
+#include "base/feature_list.h"
#include "base/logging.h"
#include "components/omnibox/browser/autocomplete_classifier.h"
#include "components/omnibox/browser/autocomplete_input.h"
@@ -39,5 +40,11 @@ AutocompleteMatch VerbatimMatchForURL(
const int kDefaultVerbatimRelevance = 1300;
match.relevance =
verbatim_relevance >= 0 ? verbatim_relevance : kDefaultVerbatimRelevance;
+ if (base::FeatureList::IsEnabled(omnibox::kDisplayTitleForCurrentUrl)) {
Mark P 2017/04/12 17:58:46 nit: include-what-you-use (omnibox_field_trial.h d
gcomanici 2017/04/12 19:25:00 I couldn't find it there. Could you be more specif
Mark P 2017/04/12 19:38:01 Please include components/omnibox/browser/omnibox_
gcomanici 2017/04/12 20:48:22 Done.
+ match.description = input.current_title();
Mark P 2017/04/12 17:58:46 |destination_url| does not necessarily correspond
gcomanici 2017/04/12 19:25:00 I made a change based on your suggestion but witho
Mark P 2017/04/12 19:38:01 No, we want the description to be the title. That'
gcomanici 2017/04/12 20:48:22 Got it. Added a check on destination_url.
Mark P 2017/04/12 21:16:57 I was more thinking that you have callers pass in
gcomanici 2017/04/13 16:38:38 Makes sense. Done.
+ AutocompleteMatch::ClassifyLocationInString(
+ base::string16::npos, 0, match.description.length(),
+ ACMatchClassification::NONE, &match.description_class);
+ }
return match;
}

Powered by Google App Engine
This is Rietveld 408576698