OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains the keyword autocomplete provider. The keyword provider | 5 // This file contains the keyword autocomplete provider. The keyword provider |
6 // is responsible for remembering/suggesting user "search keyword queries" | 6 // is responsible for remembering/suggesting user "search keyword queries" |
7 // (e.g. "imdb Godzilla") and then fixing them up into valid URLs. An | 7 // (e.g. "imdb Godzilla") and then fixing them up into valid URLs. An |
8 // instance of it gets created and managed by the autocomplete controller. | 8 // instance of it gets created and managed by the autocomplete controller. |
9 // KeywordProvider uses a TemplateURLService to find the set of keywords. | 9 // KeywordProvider uses a TemplateURLService to find the set of keywords. |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 bool support_replacement, | 120 bool support_replacement, |
121 bool prefer_keyword, | 121 bool prefer_keyword, |
122 bool allow_exact_keyword_match); | 122 bool allow_exact_keyword_match); |
123 | 123 |
124 // Creates a fully marked-up AutocompleteMatch from the user's input. | 124 // Creates a fully marked-up AutocompleteMatch from the user's input. |
125 // If |relevance| is negative, calculate a relevance based on heuristics. | 125 // If |relevance| is negative, calculate a relevance based on heuristics. |
126 AutocompleteMatch CreateAutocompleteMatch(const TemplateURL* template_url, | 126 AutocompleteMatch CreateAutocompleteMatch(const TemplateURL* template_url, |
127 const AutocompleteInput& input, | 127 const AutocompleteInput& input, |
128 size_t prefix_length, | 128 size_t prefix_length, |
129 const string16& remaining_input, | 129 const string16& remaining_input, |
| 130 bool allowed_to_be_default_match, |
130 int relevance); | 131 int relevance); |
131 | 132 |
132 // Fills in the "destination_url" and "contents" fields of |match| with the | 133 // Fills in the "destination_url" and "contents" fields of |match| with the |
133 // provided user input and keyword data. | 134 // provided user input and keyword data. |
134 void FillInURLAndContents(const string16& remaining_input, | 135 void FillInURLAndContents(const string16& remaining_input, |
135 const TemplateURL* element, | 136 const TemplateURL* element, |
136 AutocompleteMatch* match) const; | 137 AutocompleteMatch* match) const; |
137 | 138 |
138 void EnterExtensionKeywordMode(const std::string& extension_id); | 139 void EnterExtensionKeywordMode(const std::string& extension_id); |
139 void MaybeEndExtensionKeywordMode(); | 140 void MaybeEndExtensionKeywordMode(); |
(...skipping 25 matching lines...) Expand all Loading... |
165 // If non-empty, holds the ID of the extension whose keyword is currently in | 166 // If non-empty, holds the ID of the extension whose keyword is currently in |
166 // the URL bar while the autocomplete popup is open. | 167 // the URL bar while the autocomplete popup is open. |
167 std::string current_keyword_extension_id_; | 168 std::string current_keyword_extension_id_; |
168 | 169 |
169 content::NotificationRegistrar registrar_; | 170 content::NotificationRegistrar registrar_; |
170 | 171 |
171 DISALLOW_COPY_AND_ASSIGN(KeywordProvider); | 172 DISALLOW_COPY_AND_ASSIGN(KeywordProvider); |
172 }; | 173 }; |
173 | 174 |
174 #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_PROVIDER_H_ | 175 #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_PROVIDER_H_ |
OLD | NEW |