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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 // stats. | 172 // stats. |
| 173 void UpdateAssistedQueryStats(AutocompleteResult* result); | 173 void UpdateAssistedQueryStats(AutocompleteResult* result); |
| 174 | 174 |
| 175 // Calls AutocompleteControllerDelegate::OnResultChanged() and if done sends | 175 // Calls AutocompleteControllerDelegate::OnResultChanged() and if done sends |
| 176 // AUTOCOMPLETE_CONTROLLER_RESULT_READY. | 176 // AUTOCOMPLETE_CONTROLLER_RESULT_READY. |
| 177 void NotifyChanged(bool notify_default_match); | 177 void NotifyChanged(bool notify_default_match); |
| 178 | 178 |
| 179 // Updates |done_| to be accurate with respect to current providers' statuses. | 179 // Updates |done_| to be accurate with respect to current providers' statuses. |
| 180 void CheckIfDone(); | 180 void CheckIfDone(); |
| 181 | 181 |
| 182 // Starts the expire timer. | 182 // Starts |expire_timer_|. |
| 183 void StartExpireTimer(); | 183 void StartExpireTimer(); |
| 184 | 184 |
| 185 // Starts |stop_timer_|. | |
| 186 void StartStopTimer(); | |
| 187 | |
| 185 AutocompleteControllerDelegate* delegate_; | 188 AutocompleteControllerDelegate* delegate_; |
| 186 | 189 |
| 187 // A list of all providers. | 190 // A list of all providers. |
| 188 ACProviders providers_; | 191 ACProviders providers_; |
| 189 | 192 |
| 190 HistoryURLProvider* history_url_provider_; | 193 HistoryURLProvider* history_url_provider_; |
| 191 | 194 |
| 192 KeywordProvider* keyword_provider_; | 195 KeywordProvider* keyword_provider_; |
| 193 | 196 |
| 194 SearchProvider* search_provider_; | 197 SearchProvider* search_provider_; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 210 // also be more recent than the last keystroke if there was an | 213 // also be more recent than the last keystroke if there was an |
| 211 // asynchronous provider that returned and changed the default | 214 // asynchronous provider that returned and changed the default |
| 212 // match. See UpdateResult() for details on when we consider a | 215 // match. See UpdateResult() for details on when we consider a |
| 213 // match to have changed. | 216 // match to have changed. |
| 214 base::TimeTicks last_time_default_match_changed_; | 217 base::TimeTicks last_time_default_match_changed_; |
| 215 | 218 |
| 216 // Timer used to remove any matches copied from the last result. When run | 219 // Timer used to remove any matches copied from the last result. When run |
| 217 // invokes |ExpireCopiedEntries|. | 220 // invokes |ExpireCopiedEntries|. |
| 218 base::OneShotTimer<AutocompleteController> expire_timer_; | 221 base::OneShotTimer<AutocompleteController> expire_timer_; |
| 219 | 222 |
| 223 // Timer used to tell the providers to Stop() searching for matches. | |
| 224 base::OneShotTimer<AutocompleteController> stop_timer_; | |
| 225 | |
| 226 // True if the user is in the "stop timer" field trial. If so, the | |
| 227 // controller uses the |stop_timer_|. | |
| 228 bool in_stop_timer_field_trial_; | |
|
Bart N.
2013/04/19 19:57:50
Make it const.
Mark P
2013/04/19 20:20:40
Done.
| |
| 229 | |
| 220 // True if a query is not currently running. | 230 // True if a query is not currently running. |
| 221 bool done_; | 231 bool done_; |
| 222 | 232 |
| 223 // Are we in Start()? This is used to avoid updating |result_| and sending | 233 // Are we in Start()? This is used to avoid updating |result_| and sending |
| 224 // notifications until Start() has been invoked on all providers. | 234 // notifications until Start() has been invoked on all providers. |
| 225 bool in_start_; | 235 bool in_start_; |
| 226 | 236 |
| 227 // Has StartZeroSuggest() been called but not Start()? | 237 // Has StartZeroSuggest() been called but not Start()? |
| 228 bool in_zero_suggest_; | 238 bool in_zero_suggest_; |
| 229 | 239 |
| 230 Profile* profile_; | 240 Profile* profile_; |
| 231 | 241 |
| 232 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); | 242 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); |
| 233 }; | 243 }; |
| 234 | 244 |
| 235 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 245 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
| OLD | NEW |