Chromium Code Reviews| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 // if suggested relevances cause undesirable behavior. Updates |done_|. | 194 // if suggested relevances cause undesirable behavior. Updates |done_|. |
| 195 void UpdateMatches(); | 195 void UpdateMatches(); |
| 196 | 196 |
| 197 // Called when timer_ expires. | 197 // Called when timer_ expires. |
| 198 void Run(); | 198 void Run(); |
| 199 | 199 |
| 200 // Runs the history query, if necessary. The history query is synchronous. | 200 // Runs the history query, if necessary. The history query is synchronous. |
| 201 // This does not update |done_|. | 201 // This does not update |done_|. |
| 202 void DoHistoryQuery(bool minimal_changes); | 202 void DoHistoryQuery(bool minimal_changes); |
| 203 | 203 |
| 204 // Returns the time to delay before sending the Suggest request. | |
| 205 base::TimeDelta GetSuggestQueryDelay(); | |
|
Mark P
2014/10/21 21:28:22
Can this function be const?
Bart N.
2014/10/22 01:19:08
Oh yes :) not sure why I forgot that.
| |
| 206 | |
| 204 // Determines whether an asynchronous subcomponent query should run for the | 207 // Determines whether an asynchronous subcomponent query should run for the |
| 205 // current input. If so, starts it if necessary; otherwise stops it. | 208 // current input. If so, starts it if necessary; otherwise stops it. |
| 206 // NOTE: This function does not update |done_|. Callers must do so. | 209 // NOTE: This function does not update |done_|. Callers must do so. |
| 207 void StartOrStopSuggestQuery(bool minimal_changes); | 210 void StartOrStopSuggestQuery(bool minimal_changes); |
| 208 | 211 |
| 209 // Returns true when the current query can be sent to the Suggest service. | 212 // Returns true when the current query can be sent to the Suggest service. |
| 210 // This will be false e.g. when Suggest is disabled, the query contains | 213 // This will be false e.g. when Suggest is disabled, the query contains |
| 211 // potentially private data, etc. | 214 // potentially private data, etc. |
| 212 bool IsQuerySuitableForSuggest() const; | 215 bool IsQuerySuitableForSuggest() const; |
| 213 | 216 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 base::TimeTicks token_expiration_time_; | 399 base::TimeTicks token_expiration_time_; |
| 397 | 400 |
| 398 // Answers prefetch management. | 401 // Answers prefetch management. |
| 399 AnswersCache answers_cache_; // Cache for last answers seen. | 402 AnswersCache answers_cache_; // Cache for last answers seen. |
| 400 AnswersQueryData prefetch_data_; // Data to use for query prefetching. | 403 AnswersQueryData prefetch_data_; // Data to use for query prefetching. |
| 401 | 404 |
| 402 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 405 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 403 }; | 406 }; |
| 404 | 407 |
| 405 #endif // COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_ | 408 #endif // COMPONENTS_OMNIBOX_SEARCH_PROVIDER_H_ |
| OLD | NEW |