| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 122 // Compute the "alternate navigation URL" for a given match. This is obtained |
| 123 // by interpreting the user input directly as a URL. | 123 // by interpreting the user input directly as a URL. See comments on |
| 124 // |alternate_nav_url_|. |
| 124 static GURL ComputeAlternateNavUrl(const AutocompleteInput& input, | 125 static GURL ComputeAlternateNavUrl(const AutocompleteInput& input, |
| 125 const AutocompleteMatch& match); | 126 const AutocompleteMatch& match); |
| 126 | 127 |
| 127 private: | 128 private: |
| 128 typedef std::map<AutocompleteProvider*, ACMatches> ProviderToMatches; | 129 typedef std::map<AutocompleteProvider*, ACMatches> ProviderToMatches; |
| 129 | 130 |
| 130 #if defined(OS_ANDROID) | 131 #if defined(OS_ANDROID) |
| 131 // iterator::difference_type is not defined in the STL that we compile with on | 132 // iterator::difference_type is not defined in the STL that we compile with on |
| 132 // Android. | 133 // Android. |
| 133 typedef int matches_difference_type; | 134 typedef int matches_difference_type; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 158 // user's local intranet contains site "foo", and the user types "foo", we | 159 // user's local intranet contains site "foo", and the user types "foo", we |
| 159 // default to searching for "foo" when the user may have meant to navigate | 160 // default to searching for "foo" when the user may have meant to navigate |
| 160 // there. In cases like this, the default match will point to the "search for | 161 // there. In cases like this, the default match will point to the "search for |
| 161 // 'foo'" result, and this will contain "http://foo/". | 162 // 'foo'" result, and this will contain "http://foo/". |
| 162 GURL alternate_nav_url_; | 163 GURL alternate_nav_url_; |
| 163 | 164 |
| 164 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult); | 165 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult); |
| 165 }; | 166 }; |
| 166 | 167 |
| 167 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ | 168 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_RESULT_H_ |
| OLD | NEW |