Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: components/omnibox/browser/autocomplete_controller.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_
6 #define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ 6 #define COMPONENTS_OMNIBOX_BROWSER_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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // the destination match ever since the user typed "ma" then this is 225 // the destination match ever since the user typed "ma" then this is
226 // the time that URL first appeared as the default match.) This may 226 // the time that URL first appeared as the default match.) This may
227 // also be more recent than the last keystroke if there was an 227 // also be more recent than the last keystroke if there was an
228 // asynchronous provider that returned and changed the default 228 // asynchronous provider that returned and changed the default
229 // match. See UpdateResult() for details on when we consider a 229 // match. See UpdateResult() for details on when we consider a
230 // match to have changed. 230 // match to have changed.
231 base::TimeTicks last_time_default_match_changed_; 231 base::TimeTicks last_time_default_match_changed_;
232 232
233 // Timer used to remove any matches copied from the last result. When run 233 // Timer used to remove any matches copied from the last result. When run
234 // invokes |ExpireCopiedEntries|. 234 // invokes |ExpireCopiedEntries|.
235 base::OneShotTimer<AutocompleteController> expire_timer_; 235 base::OneShotTimer expire_timer_;
236 236
237 // Timer used to tell the providers to Stop() searching for matches. 237 // Timer used to tell the providers to Stop() searching for matches.
238 base::OneShotTimer<AutocompleteController> stop_timer_; 238 base::OneShotTimer stop_timer_;
239 239
240 // Amount of time (in ms) between when the user stops typing and 240 // Amount of time (in ms) between when the user stops typing and
241 // when we send Stop() to every provider. This is intended to avoid 241 // when we send Stop() to every provider. This is intended to avoid
242 // the disruptive effect of belated omnibox updates, updates that 242 // the disruptive effect of belated omnibox updates, updates that
243 // come after the user has had to time to read the whole dropdown 243 // come after the user has had to time to read the whole dropdown
244 // and doesn't expect it to change. 244 // and doesn't expect it to change.
245 const base::TimeDelta stop_timer_duration_; 245 const base::TimeDelta stop_timer_duration_;
246 246
247 // True if a query is not currently running. 247 // True if a query is not currently running.
248 bool done_; 248 bool done_;
249 249
250 // Are we in Start()? This is used to avoid updating |result_| and sending 250 // Are we in Start()? This is used to avoid updating |result_| and sending
251 // notifications until Start() has been invoked on all providers. 251 // notifications until Start() has been invoked on all providers.
252 bool in_start_; 252 bool in_start_;
253 253
254 TemplateURLService* template_url_service_; 254 TemplateURLService* template_url_service_;
255 255
256 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); 256 DISALLOW_COPY_AND_ASSIGN(AutocompleteController);
257 }; 257 };
258 258
259 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_ 259 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « components/metrics/metrics_reporting_scheduler.h ('k') | components/omnibox/browser/search_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698