| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Clears the matches for this result set. | 112 // Clears the matches for this result set. |
| 113 void Reset(); | 113 void Reset(); |
| 114 | 114 |
| 115 void Swap(AutocompleteResult* other); | 115 void Swap(AutocompleteResult* other); |
| 116 | 116 |
| 117 #ifndef NDEBUG | 117 #ifndef NDEBUG |
| 118 // Does a data integrity check on this result. | 118 // Does a data integrity check on this result. |
| 119 void Validate() const; | 119 void Validate() const; |
| 120 #endif | 120 #endif |
| 121 | 121 |
| 122 // Compute the "alternate navigation URL" for a given match. This is obtained |
| 123 // by interpreting the user input directly as a URL. |
| 124 static GURL ComputeAlternateNavUrl(const AutocompleteInput& input, |
| 125 const AutocompleteMatch& match); |
| 126 |
| 122 private: | 127 private: |
| 123 typedef std::map<AutocompleteProvider*, ACMatches> ProviderToMatches; | 128 typedef std::map<AutocompleteProvider*, ACMatches> ProviderToMatches; |
| 124 | 129 |
| 125 #if defined(OS_ANDROID) | 130 #if defined(OS_ANDROID) |
| 126 // iterator::difference_type is not defined in the STL that we compile with on | 131 // iterator::difference_type is not defined in the STL that we compile with on |
| 127 // Android. | 132 // Android. |
| 128 typedef int matches_difference_type; | 133 typedef int matches_difference_type; |
| 129 #else | 134 #else |
| 130 typedef ACMatches::iterator::difference_type matches_difference_type; | 135 typedef ACMatches::iterator::difference_type matches_difference_type; |
| 131 #endif | 136 #endif |
| (...skipping 21 matching lines...) Expand all Loading... |
| 153 // user's local intranet contains site "foo", and the user types "foo", we | 158 // user's local intranet contains site "foo", and the user types "foo", we |
| 154 // default to searching for "foo" when the user may have meant to navigate | 159 // default to searching for "foo" when the user may have meant to navigate |
| 155 // there. In cases like this, the default match will point to the "search for | 160 // there. In cases like this, the default match will point to the "search for |
| 156 // 'foo'" result, and this will contain "http://foo/". | 161 // 'foo'" result, and this will contain "http://foo/". |
| 157 GURL alternate_nav_url_; | 162 GURL alternate_nav_url_; |
| 158 | 163 |
| 159 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult); | 164 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult); |
| 160 }; | 165 }; |
| 161 | 166 |
| 162 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ | 167 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ |
| OLD | NEW |