| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 AutocompleteMatch(const AutocompleteMatch& match); | 93 AutocompleteMatch(const AutocompleteMatch& match); |
| 94 ~AutocompleteMatch(); | 94 ~AutocompleteMatch(); |
| 95 | 95 |
| 96 // Converts |type| to a string representation. Used in logging and debugging. | 96 // Converts |type| to a string representation. Used in logging and debugging. |
| 97 AutocompleteMatch& operator=(const AutocompleteMatch& match); | 97 AutocompleteMatch& operator=(const AutocompleteMatch& match); |
| 98 | 98 |
| 99 // Converts |type| to a resource identifier for the appropriate icon for this | 99 // Converts |type| to a resource identifier for the appropriate icon for this |
| 100 // type to show in the completion popup. | 100 // type to show in the completion popup. |
| 101 static int TypeToIcon(Type type); | 101 static int TypeToIcon(Type type); |
| 102 | 102 |
| 103 // Converts |type| to a resource identifier for the appropriate icon for this | |
| 104 // type to show in the location bar. | |
| 105 static int TypeToLocationBarIcon(Type type); | |
| 106 | |
| 107 // Comparison function for determining when one match is better than another. | 103 // Comparison function for determining when one match is better than another. |
| 108 static bool MoreRelevant(const AutocompleteMatch& elem1, | 104 static bool MoreRelevant(const AutocompleteMatch& elem1, |
| 109 const AutocompleteMatch& elem2); | 105 const AutocompleteMatch& elem2); |
| 110 | 106 |
| 111 // Comparison function for removing matches with duplicate destinations. | 107 // Comparison function for removing matches with duplicate destinations. |
| 112 // Destinations are compared using |stripped_destination_url|. Pairs of | 108 // Destinations are compared using |stripped_destination_url|. Pairs of |
| 113 // matches with empty destinations are treated as differing, since empty | 109 // matches with empty destinations are treated as differing, since empty |
| 114 // destinations are expected for non-navigable matches. | 110 // destinations are expected for non-navigable matches. |
| 115 static bool DestinationsEqual(const AutocompleteMatch& elem1, | 111 static bool DestinationsEqual(const AutocompleteMatch& elem1, |
| 116 const AutocompleteMatch& elem2); | 112 const AutocompleteMatch& elem2); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 const base::string16& text, | 383 const base::string16& text, |
| 388 const ACMatchClassifications& classifications) const; | 384 const ACMatchClassifications& classifications) const; |
| 389 #endif | 385 #endif |
| 390 }; | 386 }; |
| 391 | 387 |
| 392 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 388 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
| 393 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 389 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
| 394 typedef std::vector<AutocompleteMatch> ACMatches; | 390 typedef std::vector<AutocompleteMatch> ACMatches; |
| 395 | 391 |
| 396 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 392 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
| OLD | NEW |