summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/search_provider.h
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-03 18:18:14 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-03 18:18:14 +0000
commit2d31666a58e746b7a1d415c99e5f68ad9256d236 (patch)
tree144c99d4b80df0f0f9a3ded83f9d21a8b36f17cc /chrome/browser/autocomplete/search_provider.h
parent90d6958fe2374a00d3c8583cf4d3b8a509ae8e90 (diff)
downloadchromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.zip
chromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.tar.gz
chromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.tar.bz2
Minor cleanup to OneShotTimer and RepeatingTimer: moves more of the member variables into the Task subclass.
Also included in this change: deprecate MessageLoop::timer_manager(), and change consumers over to use OneShotTimer or RepeatingTimer. R=beng BUG=1346553 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/search_provider.h')
-rw-r--r--chrome/browser/autocomplete/search_provider.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h
index 9af8a53..4c509c5 100644
--- a/chrome/browser/autocomplete/search_provider.h
+++ b/chrome/browser/autocomplete/search_provider.h
@@ -34,14 +34,11 @@ class Value;
// comes back, the provider creates and returns matches for the best
// suggestions.
class SearchProvider : public AutocompleteProvider,
- public URLFetcher::Delegate,
- public Task {
+ public URLFetcher::Delegate {
public:
SearchProvider(ACProviderListener* listener, Profile* profile)
: AutocompleteProvider(listener, profile, "Search"),
last_default_provider_(NULL),
-#pragma warning(suppress: 4355) // Okay to pass "this" here.
- timer_(new Timer(kQueryDelayMs, this, false)),
fetcher_(NULL),
history_request_pending_(false),
have_history_results_(false),
@@ -63,9 +60,6 @@ class SearchProvider : public AutocompleteProvider,
const ResponseCookies& cookies,
const std::string& data);
- // Task
- void Run();
-
private:
struct NavigationResult {
NavigationResult(const std::wstring& url, const std::wstring& site_name)
@@ -85,6 +79,9 @@ class SearchProvider : public AutocompleteProvider,
typedef std::vector<history::KeywordSearchTermVisit> HistoryResults;
typedef std::map<std::wstring, AutocompleteMatch> MatchMap;
+ // Called when timer_ expires.
+ void Run();
+
// Determines whether an asynchronous subcomponent query should run for the
// current input. If so, starts it if necessary; otherwise stops it.
// NOTE: These functions do not update |done_|. Callers must do so.
@@ -173,7 +170,7 @@ class SearchProvider : public AutocompleteProvider,
// A timer to start a query to the suggest server after the user has stopped
// typing for long enough.
- scoped_ptr<Timer> timer_;
+ base::OneShotTimer<SearchProvider> timer_;
// The fetcher that retrieves suggest results from the server.
scoped_ptr<URLFetcher> fetcher_;