| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Called after ParseSuggestResults to rank the |results|. | 189 // Called after ParseSuggestResults to rank the |results|. |
| 190 void SortResults(bool is_keyword, SearchSuggestionParser::Results* results); | 190 void SortResults(bool is_keyword, SearchSuggestionParser::Results* results); |
| 191 | 191 |
| 192 // Records UMA statistics about a suggest server response. | 192 // Records UMA statistics about a suggest server response. |
| 193 void LogFetchComplete(bool success, bool is_keyword); | 193 void LogFetchComplete(bool success, bool is_keyword); |
| 194 | 194 |
| 195 // Updates |matches_| from the latest results; applies calculated relevances | 195 // Updates |matches_| from the latest results; applies calculated relevances |
| 196 // if suggested relevances cause undesirable behavior. Updates |done_|. | 196 // if suggested relevances cause undesirable behavior. Updates |done_|. |
| 197 void UpdateMatches(); | 197 void UpdateMatches(); |
| 198 | 198 |
| 199 // Check constraints that may be violated by suggested relevances and revises/ | 199 // Checks constraints that may be violated by suggested relevances and |
| 200 // rolls back the suggested relevance scores to make all constraints old. | 200 // revises/rolls back the suggested relevance scores to make all constraints |
| 201 // hold. |
| 201 void EnforceConstraints(); | 202 void EnforceConstraints(); |
| 202 | 203 |
| 203 // Record the top suggestion (if any) for future use. SearchProvider tries | 204 // Records the top suggestion (if any) for future use. SearchProvider tries |
| 204 // to ensure that an inline autocomplete suggestion does not change | 205 // to ensure that an inline autocomplete suggestion does not change |
| 205 // asynchronously. | 206 // asynchronously. |
| 206 void RecordTopSuggestion(); | 207 void RecordTopSuggestion(); |
| 207 | 208 |
| 208 // Called when |timer_| expires. Sends the suggest requests. | 209 // Called when |timer_| expires. Sends the suggest requests. |
| 209 // If |query_is_private|, the function doesn't send this query to the default | 210 // If |query_is_private|, the function doesn't send this query to the default |
| 210 // provider. | 211 // provider. |
| 211 void Run(bool query_is_private); | 212 void Run(bool query_is_private); |
| 212 | 213 |
| 213 // Runs the history query, if necessary. The history query is synchronous. | 214 // Runs the history query, if necessary. The history query is synchronous. |
| (...skipping 198 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_BROWSER_SEARCH_PROVIDER_H_ | 422 #endif // COMPONENTS_OMNIBOX_BROWSER_SEARCH_PROVIDER_H_ |
| OLD | NEW |