1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/omnibox/browser/verbatim_match.h"
7 #include "components/omnibox/browser/autocomplete_classifier.h"
8 #include "components/omnibox/browser/autocomplete_provider_client.h"
10 AutocompleteMatch
VerbatimMatchForURL(
11 AutocompleteProviderClient
* client
,
12 const base::string16
& input_text
,
13 metrics::OmniboxEventProto::PageClassification classification
,
14 int verbatim_relevance
) {
15 AutocompleteMatch match
;
16 client
->Classify(input_text
, false, true, classification
, &match
, nullptr);
17 match
.allowed_to_be_default_match
= true;
18 // The default relevance to use for relevance match. Should be greater than
19 // all relevance matches returned by the ZeroSuggest server.
20 const int kDefaultVerbatimRelevance
= 1300;
22 verbatim_relevance
>= 0 ? verbatim_relevance
: kDefaultVerbatimRelevance
;