| 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 autocomplete entries that start with "Search <engine> | 6 // responsible for all autocomplete entries that start with "Search <engine> |
| 7 // for ...", including searching for the current input string, search | 7 // for ...", including searching for the current input string, search |
| 8 // history, and search suggestions. An instance of it gets created and | 8 // 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 void PersistTopSuggestions(SearchSuggestionParser::Results* results); | 243 void PersistTopSuggestions(SearchSuggestionParser::Results* results); |
| 244 | 244 |
| 245 // Apply calculated relevance scores to the current results. | 245 // Apply calculated relevance scores to the current results. |
| 246 void ApplyCalculatedSuggestRelevance( | 246 void ApplyCalculatedSuggestRelevance( |
| 247 SearchSuggestionParser::SuggestResults* list); | 247 SearchSuggestionParser::SuggestResults* list); |
| 248 void ApplyCalculatedNavigationRelevance( | 248 void ApplyCalculatedNavigationRelevance( |
| 249 SearchSuggestionParser::NavigationResults* list); | 249 SearchSuggestionParser::NavigationResults* list); |
| 250 | 250 |
| 251 // Starts a new URLFetcher requesting suggest results from |template_url|; | 251 // Starts a new URLFetcher requesting suggest results from |template_url|; |
| 252 // callers own the returned URLFetcher, which is NULL for invalid providers. | 252 // callers own the returned URLFetcher, which is NULL for invalid providers. |
| 253 net::URLFetcher* CreateSuggestFetcher(int id, | 253 scoped_ptr<net::URLFetcher> CreateSuggestFetcher( |
| 254 const TemplateURL* template_url, | 254 int id, |
| 255 const AutocompleteInput& input); | 255 const TemplateURL* template_url, |
| 256 const AutocompleteInput& input); |
| 256 | 257 |
| 257 // Converts the parsed results to a set of AutocompleteMatches, |matches_|. | 258 // Converts the parsed results to a set of AutocompleteMatches, |matches_|. |
| 258 void ConvertResultsToAutocompleteMatches(); | 259 void ConvertResultsToAutocompleteMatches(); |
| 259 | 260 |
| 260 // Remove answer contents from each match in |matches| other than the first | 261 // Remove answer contents from each match in |matches| other than the first |
| 261 // that appears. | 262 // that appears. |
| 262 static void RemoveExtraAnswers(ACMatches* matches); | 263 static void RemoveExtraAnswers(ACMatches* matches); |
| 263 | 264 |
| 264 // Returns an iterator to the first match in |matches_| which might | 265 // Returns an iterator to the first match in |matches_| which might |
| 265 // be chosen as default. | 266 // be chosen as default. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 base::TimeTicks token_expiration_time_; | 413 base::TimeTicks token_expiration_time_; |
| 413 | 414 |
| 414 // Answers prefetch management. | 415 // Answers prefetch management. |
| 415 AnswersCache answers_cache_; // Cache for last answers seen. | 416 AnswersCache answers_cache_; // Cache for last answers seen. |
| 416 AnswersQueryData prefetch_data_; // Data to use for query prefetching. | 417 AnswersQueryData prefetch_data_; // Data to use for query prefetching. |
| 417 | 418 |
| 418 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 419 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 419 }; | 420 }; |
| 420 | 421 |
| 421 #endif // COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_ | 422 #endif // COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_ |
| OLD | NEW |