diff options
Diffstat (limited to 'chrome/browser/autocomplete/search_provider.h')
-rw-r--r-- | chrome/browser/autocomplete/search_provider.h | 13 |
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_; |