Chromium Code Reviews| 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_RESULT_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 #else | 129 #else |
| 130 typedef ACMatches::iterator::difference_type matches_difference_type; | 130 typedef ACMatches::iterator::difference_type matches_difference_type; |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 // operator=() by another name. | 133 // operator=() by another name. |
| 134 void CopyFrom(const AutocompleteResult& rhs); | 134 void CopyFrom(const AutocompleteResult& rhs); |
| 135 | 135 |
| 136 // Adds a single match. The match is inserted at the appropriate position | 136 // Adds a single match. The match is inserted at the appropriate position |
| 137 // based on relevancy and display order. This is ONLY for use after | 137 // based on relevancy and display order. This is ONLY for use after |
| 138 // SortAndCull() has been invoked, and preserves default_match_. | 138 // SortAndCull() has been invoked, and preserves default_match_. |
| 139 void AddMatch(const AutocompleteMatch& match); | 139 void AddMatch(const AutocompleteInput& input, |
|
Peter Kasting
2013/08/06 19:33:50
I think you should just pass the actual PageClassi
Mark P
2013/08/06 22:00:15
Done (both places).
| |
| 140 const AutocompleteMatch& match); | |
| 140 | 141 |
| 141 // Populates |provider_to_matches| from |matches_|. | 142 // Populates |provider_to_matches| from |matches_|. |
| 142 void BuildProviderToMatches(ProviderToMatches* provider_to_matches) const; | 143 void BuildProviderToMatches(ProviderToMatches* provider_to_matches) const; |
| 143 | 144 |
| 144 // Returns true if |matches| contains a match with the same destination as | 145 // Returns true if |matches| contains a match with the same destination as |
| 145 // |match|. | 146 // |match|. |
| 146 static bool HasMatchByDestination(const AutocompleteMatch& match, | 147 static bool HasMatchByDestination(const AutocompleteMatch& match, |
| 147 const ACMatches& matches); | 148 const ACMatches& matches); |
| 148 | 149 |
| 149 // Copies matches into this result. |old_matches| gives the matches from the | 150 // Copies matches into this result. |old_matches| gives the matches from the |
| 150 // last result, and |new_matches| the results from this result. | 151 // last result, and |new_matches| the results from this result. |
| 151 void MergeMatchesByProvider(const ACMatches& old_matches, | 152 void MergeMatchesByProvider(const AutocompleteInput& input, |
| 153 const ACMatches& old_matches, | |
| 152 const ACMatches& new_matches); | 154 const ACMatches& new_matches); |
| 153 | 155 |
| 154 ACMatches matches_; | 156 ACMatches matches_; |
| 155 | 157 |
| 156 const_iterator default_match_; | 158 const_iterator default_match_; |
| 157 | 159 |
| 158 // The "alternate navigation URL", if any, for this result set. This is a URL | 160 // The "alternate navigation URL", if any, for this result set. This is a URL |
| 159 // to try offering as a navigational option in case the user navigated to the | 161 // to try offering as a navigational option in case the user navigated to the |
| 160 // URL of the default match but intended something else. For example, if the | 162 // URL of the default match but intended something else. For example, if the |
| 161 // user's local intranet contains site "foo", and the user types "foo", we | 163 // user's local intranet contains site "foo", and the user types "foo", we |
| 162 // default to searching for "foo" when the user may have meant to navigate | 164 // default to searching for "foo" when the user may have meant to navigate |
| 163 // there. In cases like this, the default match will point to the "search for | 165 // there. In cases like this, the default match will point to the "search for |
| 164 // 'foo'" result, and this will contain "http://foo/". | 166 // 'foo'" result, and this will contain "http://foo/". |
| 165 GURL alternate_nav_url_; | 167 GURL alternate_nav_url_; |
| 166 | 168 |
| 167 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult); | 169 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult); |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ | 172 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ |
| OLD | NEW |