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

Unified Diff: athena/main/url_search_provider.cc

Issue 559973002: Add what-you-typed-match as a result when the input type is URL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/main/url_search_provider.cc
diff --git a/athena/main/url_search_provider.cc b/athena/main/url_search_provider.cc
index 8c51952adaa0be1ac514c6db7eed5de6d35118bc..6defeef8d0d1cb2cfc82b1ffc0ff2f4257baa31a 100644
--- a/athena/main/url_search_provider.cc
+++ b/athena/main/url_search_provider.cc
@@ -26,6 +26,8 @@ namespace athena {
namespace {
+const int kScoreForWhatYouTypedResult = 1203;
Jun Mukai 2014/09/10 17:13:32 how it's determined? If you copy this value from
hashimoto 2014/09/11 02:37:14 This constant was copied from HistoryURLProvider.
+
// The SearchTermsData implementation for Athena.
class AthenaSearchTermsData : public SearchTermsData {
public:
@@ -266,6 +268,17 @@ void UrlSearchProvider::OnProviderUpdate(bool updated_matches) {
ClearResults();
+ if (input_.type() == metrics::OmniboxInputType::URL) {
+ // TODO(hashimoto): Componentize HistoryURLProvider and remove this code.
+ AutocompleteMatch what_you_typed_match(
+ NULL, 0, false, AutocompleteMatchType::URL_WHAT_YOU_TYPED);
+ what_you_typed_match.destination_url = input_.canonicalized_url();
+ what_you_typed_match.contents = input_.text();
+ what_you_typed_match.relevance = kScoreForWhatYouTypedResult;
+ Add(scoped_ptr<app_list::SearchResult>(new UrlSearchResult(
+ browser_context_, what_you_typed_match)));
+ }
+
const ACMatches& matches = provider_->matches();
for (ACMatches::const_iterator it = matches.begin(); it != matches.end();
++it) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698