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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 // This string is loaded into the location bar when the item is selected | 244 // This string is loaded into the location bar when the item is selected |
245 // by pressing the arrow keys. This may be different than a URL, for example, | 245 // by pressing the arrow keys. This may be different than a URL, for example, |
246 // for search suggestions, this would just be the search terms. | 246 // for search suggestions, this would just be the search terms. |
247 string16 fill_into_edit; | 247 string16 fill_into_edit; |
248 | 248 |
249 // The inline autocompletion to display after the user's typing in the | 249 // The inline autocompletion to display after the user's typing in the |
250 // omnibox, if this match becomes the default match. It may be empty. | 250 // omnibox, if this match becomes the default match. It may be empty. |
251 string16 inline_autocompletion; | 251 string16 inline_autocompletion; |
252 | 252 |
| 253 // If false, the omnibox should prevent this match from being the |
| 254 // default match. Providers should set this to true only if the |
| 255 // user's input, plus any inline autocompletion on this match, would |
| 256 // lead the user to expect a navigation to this match's destination. |
| 257 // For example, with input "foo", a search for "bar" or navigation |
| 258 // to "bar.com" should not set this flag; a navigation to "foo.com" |
| 259 // should only set this flag if ".com" will be inline autocompleted; |
| 260 // and a navigation to "foo/" (an intranet host) or search for "foo" |
| 261 // should set this flag. |
| 262 bool allowed_to_be_default_match; |
| 263 |
253 // The URL to actually load when the autocomplete item is selected. This URL | 264 // The URL to actually load when the autocomplete item is selected. This URL |
254 // should be canonical so we can compare URLs with strcmp to avoid dupes. | 265 // should be canonical so we can compare URLs with strcmp to avoid dupes. |
255 // It may be empty if there is no possible navigation. | 266 // It may be empty if there is no possible navigation. |
256 GURL destination_url; | 267 GURL destination_url; |
257 | 268 |
258 // The destination URL with "www." stripped off for better dupe finding. | 269 // The destination URL with "www." stripped off for better dupe finding. |
259 GURL stripped_destination_url; | 270 GURL stripped_destination_url; |
260 | 271 |
261 // The main text displayed in the address bar dropdown. | 272 // The main text displayed in the address bar dropdown. |
262 string16 contents; | 273 string16 contents; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 const string16& text, | 335 const string16& text, |
325 const ACMatchClassifications& classifications) const; | 336 const ACMatchClassifications& classifications) const; |
326 #endif | 337 #endif |
327 }; | 338 }; |
328 | 339 |
329 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 340 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
330 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 341 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
331 typedef std::vector<AutocompleteMatch> ACMatches; | 342 typedef std::vector<AutocompleteMatch> ACMatches; |
332 | 343 |
333 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 344 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |