Commit 51b4fe1f authored by hashimoto's avatar hashimoto Committed by Commit bot

Add what-you-typed-match as a result when the input type is URL

BUG=411426

Review URL: https://codereview.chromium.org/559973002

Cr-Commit-Position: refs/heads/master@{#294315}
parent 254dfde3
......@@ -26,6 +26,10 @@ namespace athena {
namespace {
// This constant was copied from HistoryURLProvider.
// TODO(hashimoto): Componentize HistoryURLProvider and delete this.
const int kScoreForWhatYouTypedResult = 1203;
// The SearchTermsData implementation for Athena.
class AthenaSearchTermsData : public SearchTermsData {
public:
......@@ -266,6 +270,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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment