| 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_HISTORY_URL_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // This class is an autocomplete provider and is also a pseudo-internal | 135 // This class is an autocomplete provider and is also a pseudo-internal |
| 136 // component of the history system. See comments above. | 136 // component of the history system. See comments above. |
| 137 class HistoryURLProvider : public HistoryProvider { | 137 class HistoryURLProvider : public HistoryProvider { |
| 138 public: | 138 public: |
| 139 HistoryURLProvider(AutocompleteProviderListener* listener, Profile* profile); | 139 HistoryURLProvider(AutocompleteProviderListener* listener, Profile* profile); |
| 140 | 140 |
| 141 #ifdef UNIT_TEST | 141 #ifdef UNIT_TEST |
| 142 HistoryURLProvider(AutocompleteProviderListener* listener, | 142 HistoryURLProvider(AutocompleteProviderListener* listener, |
| 143 Profile* profile, | 143 Profile* profile, |
| 144 const std::string& languages) | 144 const std::string& languages) |
| 145 : HistoryProvider(listener, profile, "History"), | 145 : HistoryProvider(listener, profile, |
| 146 AutocompleteProvider::TYPE_HISTORY_URL), |
| 146 params_(NULL), | 147 params_(NULL), |
| 147 languages_(languages) {} | 148 languages_(languages) {} |
| 148 #endif | 149 #endif |
| 149 | 150 |
| 150 // Returns a match corresponding to exactly what the user has typed. | 151 // Returns a match corresponding to exactly what the user has typed. |
| 151 // NOTE: This does not set the relevance of the returned match, as different | 152 // NOTE: This does not set the relevance of the returned match, as different |
| 152 // callers want different behavior. Callers must set this manually. | 153 // callers want different behavior. Callers must set this manually. |
| 153 // This function is static so SearchProvider may construct similar matches. | 154 // This function is static so SearchProvider may construct similar matches. |
| 154 static AutocompleteMatch SuggestExactInput(AutocompleteProvider* provider, | 155 static AutocompleteMatch SuggestExactInput(AutocompleteProvider* provider, |
| 155 const AutocompleteInput& input, | 156 const AutocompleteInput& input, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // parameter itself is freed once it's no longer needed. The only reason we | 279 // parameter itself is freed once it's no longer needed. The only reason we |
| 279 // keep this member is so we can set the cancel bit on it. | 280 // keep this member is so we can set the cancel bit on it. |
| 280 HistoryURLProviderParams* params_; | 281 HistoryURLProviderParams* params_; |
| 281 | 282 |
| 282 // Only used by unittests; if non-empty, overrides accept-languages in the | 283 // Only used by unittests; if non-empty, overrides accept-languages in the |
| 283 // profile's pref system. | 284 // profile's pref system. |
| 284 std::string languages_; | 285 std::string languages_; |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 288 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
| OLD | NEW |