| 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 // This file contains the Search autocomplete provider. This provider is | 5 // This file contains the Search autocomplete provider. This provider is |
| 6 // responsible for all non-keyword autocomplete entries that start with | 6 // responsible for all non-keyword autocomplete entries that start with |
| 7 // "Search <engine> for ...", including searching for the current input string, | 7 // "Search <engine> for ...", including searching for the current input string, |
| 8 // search history, and search suggestions. An instance of it gets created and | 8 // search history, and search suggestions. An instance of it gets created and |
| 9 // managed by the autocomplete controller. | 9 // managed by the autocomplete controller. |
| 10 | 10 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void RemoveStaleResults(); | 232 void RemoveStaleResults(); |
| 233 void RemoveStaleSuggestResults(SuggestResults* list, bool is_keyword); | 233 void RemoveStaleSuggestResults(SuggestResults* list, bool is_keyword); |
| 234 void RemoveStaleNavigationResults(NavigationResults* list, bool is_keyword); | 234 void RemoveStaleNavigationResults(NavigationResults* list, bool is_keyword); |
| 235 | 235 |
| 236 // Apply calculated relevance scores to the current results. | 236 // Apply calculated relevance scores to the current results. |
| 237 void ApplyCalculatedRelevance(); | 237 void ApplyCalculatedRelevance(); |
| 238 void ApplyCalculatedSuggestRelevance(SuggestResults* list, bool is_keyword); | 238 void ApplyCalculatedSuggestRelevance(SuggestResults* list, bool is_keyword); |
| 239 void ApplyCalculatedNavigationRelevance(NavigationResults* list, | 239 void ApplyCalculatedNavigationRelevance(NavigationResults* list, |
| 240 bool is_keyword); | 240 bool is_keyword); |
| 241 | 241 |
| 242 // Creates a URLFetcher requesting suggest results from the specified | 242 // Starts a new URLFetcher requesting suggest results from |template_url|; |
| 243 // |suggestions_url|. The caller owns the returned URLFetcher. | 243 // callers own the returned URLFetcher, which is NULL for invalid providers. |
| 244 net::URLFetcher* CreateSuggestFetcher( | 244 net::URLFetcher* CreateSuggestFetcher(int id, |
| 245 int id, | 245 const TemplateURL* template_url, |
| 246 const TemplateURLRef& suggestions_url, | 246 const string16& text); |
| 247 const string16& text); | |
| 248 | 247 |
| 249 // Parses results from the suggest server and updates the appropriate suggest | 248 // Parses results from the suggest server and updates the appropriate suggest |
| 250 // and navigation result lists, depending on whether |is_keyword| is true. | 249 // and navigation result lists, depending on whether |is_keyword| is true. |
| 251 // Returns whether the appropriate result list members were updated. | 250 // Returns whether the appropriate result list members were updated. |
| 252 bool ParseSuggestResults(base::Value* root_val, bool is_keyword); | 251 bool ParseSuggestResults(base::Value* root_val, bool is_keyword); |
| 253 | 252 |
| 254 // Converts the parsed results to a set of AutocompleteMatches and adds them | 253 // Converts the parsed results to a set of AutocompleteMatches and adds them |
| 255 // to |matches_|. This also sets |done_| correctly. | 254 // to |matches_|. This also sets |done_| correctly. |
| 256 void ConvertResultsToAutocompleteMatches(); | 255 void ConvertResultsToAutocompleteMatches(); |
| 257 | 256 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // Has FinalizeInstantQuery been invoked since the last |Start|? | 374 // Has FinalizeInstantQuery been invoked since the last |Start|? |
| 376 bool instant_finalized_; | 375 bool instant_finalized_; |
| 377 | 376 |
| 378 // The |suggest_text| parameter passed to FinalizeInstantQuery. | 377 // The |suggest_text| parameter passed to FinalizeInstantQuery. |
| 379 string16 default_provider_suggest_text_; | 378 string16 default_provider_suggest_text_; |
| 380 | 379 |
| 381 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 380 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 382 }; | 381 }; |
| 383 | 382 |
| 384 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 383 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |