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) { |