| 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 // Swaps the contents and description fields, and their associated |
| 264 // classifications, if this is a match for which we should emphasize the |
| 265 // title (stored in the description field) over the URL (in the contents |
| 266 // field). See the implementation for the conditions under which this is |
| 267 // true. |
| 268 void PossiblySwapContentsAndDescriptionForURLSuggestion( |
| 269 const AutocompleteInput& input); |
| 270 |
| 262 // The provider of this match, used to remember which provider the user had | 271 // 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 | 272 // selected when the input changes. This may be NULL, in which case there is |
| 264 // no provider (or memory of the user's selection). | 273 // no provider (or memory of the user's selection). |
| 265 AutocompleteProvider* provider; | 274 AutocompleteProvider* provider; |
| 266 | 275 |
| 267 // The relevance of this match. See table in autocomplete.h for scores | 276 // 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 | 277 // returned by various providers. This is used to rank matches among all |
| 269 // responding providers, so different providers must be carefully tuned to | 278 // responding providers, so different providers must be carefully tuned to |
| 270 // supply matches with appropriate relevance. | 279 // supply matches with appropriate relevance. |
| 271 // | 280 // |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 const base::string16& text, | 394 const base::string16& text, |
| 386 const ACMatchClassifications& classifications) const; | 395 const ACMatchClassifications& classifications) const; |
| 387 #endif | 396 #endif |
| 388 }; | 397 }; |
| 389 | 398 |
| 390 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 399 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
| 391 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 400 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
| 392 typedef std::vector<AutocompleteMatch> ACMatches; | 401 typedef std::vector<AutocompleteMatch> ACMatches; |
| 393 | 402 |
| 394 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ | 403 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_MATCH_H_ |
| OLD | NEW |