Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ | 5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ |
| 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ | 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "components/omnibox/autocomplete_input.h" | |
| 13 #include "components/omnibox/autocomplete_match_type.h" | 14 #include "components/omnibox/autocomplete_match_type.h" |
| 14 #include "components/search_engines/template_url.h" | 15 #include "components/search_engines/template_url.h" |
| 15 #include "ui/base/page_transition_types.h" | 16 #include "ui/base/page_transition_types.h" |
| 16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 17 | 18 |
| 18 class AutocompleteProvider; | 19 class AutocompleteProvider; |
| 19 class SuggestionAnswer; | 20 class SuggestionAnswer; |
| 20 class TemplateURL; | 21 class TemplateURL; |
| 21 class TemplateURLService; | 22 class TemplateURLService; |
| 22 | 23 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 // such as keyword engine matches or extension-provided matches, aren't | 253 // such as keyword engine matches or extension-provided matches, aren't |
| 253 // detected by this IsVerbatimType, as the user will not be able to infer | 254 // detected by this IsVerbatimType, as the user will not be able to infer |
| 254 // what will happen when he or she presses enter in those cases if the match | 255 // what will happen when he or she presses enter in those cases if the match |
| 255 // is not shown. | 256 // is not shown. |
| 256 bool IsVerbatimType() const; | 257 bool IsVerbatimType() const; |
| 257 | 258 |
| 258 // Returns whether this match or any duplicate of this match can be deleted. | 259 // Returns whether this match or any duplicate of this match can be deleted. |
| 259 // This is used to decide whether we should call DeleteMatch(). | 260 // This is used to decide whether we should call DeleteMatch(). |
| 260 bool SupportsDeletion() const; | 261 bool SupportsDeletion() const; |
| 261 | 262 |
| 263 // For some inputs, possibly swaps the contents and descriptions fields and | |
| 264 // their associated classifications for a URL suggestion. This is meant to | |
| 265 // emphasize descriptions (i.e., titles of URLs) rather than the contents | |
| 266 // (i.e., the URL itself) under some conditions. | |
|
Peter Kasting
2015/05/21 21:55:33
Nit: How about:
Swaps the contents and descriptio
Mark P
2015/05/22 22:51:29
Sure, that sounds cleaner.
| |
| 267 void PossiblySwapContentsAndDescriptionForURLSuggestion( | |
| 268 const AutocompleteInput& input); | |
| 269 | |
| 262 // The provider of this match, used to remember which provider the user had | 270 // The provider of this match, used to remember which provider the user had |
| 263 // selected when the input changes. This may be NULL, in which case there is | 271 // selected when the input changes. This may be NULL, in which case there is |
| 264 // no provider (or memory of the user's selection). | 272 // no provider (or memory of the user's selection). |
| 265 AutocompleteProvider* provider; | 273 AutocompleteProvider* provider; |
| 266 | 274 |
| 267 // The relevance of this match. See table in autocomplete.h for scores | 275 // The relevance of this match. See table in autocomplete.h for scores |
| 268 // returned by various providers. This is used to rank matches among all | 276 // returned by various providers. This is used to rank matches among all |
| 269 // responding providers, so different providers must be carefully tuned to | 277 // responding providers, so different providers must be carefully tuned to |
| 270 // supply matches with appropriate relevance. | 278 // supply matches with appropriate relevance. |
| 271 // | 279 // |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 const base::string16& text, | 393 const base::string16& text, |
| 386 const ACMatchClassifications& classifications) const; | 394 const ACMatchClassifications& classifications) const; |
| 387 #endif | 395 #endif |
| 388 }; | 396 }; |
| 389 | 397 |
| 390 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 398 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
| 391 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 399 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
| 392 typedef std::vector<AutocompleteMatch> ACMatches; | 400 typedef std::vector<AutocompleteMatch> ACMatches; |
| 393 | 401 |
| 394 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ | 402 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ |
| OLD | NEW |