diff options
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/history_contents_provider.cc | 15 | ||||
-rw-r--r-- | chrome/browser/autocomplete/history_contents_provider.h | 13 | ||||
-rw-r--r-- | chrome/browser/autocomplete/search_provider.cc | 11 | ||||
-rw-r--r-- | chrome/browser/autocomplete/search_provider.h | 10 |
4 files changed, 30 insertions, 19 deletions
diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc index da748d7..911f429 100644 --- a/chrome/browser/autocomplete/history_contents_provider.cc +++ b/chrome/browser/autocomplete/history_contents_provider.cc @@ -50,6 +50,18 @@ bool CompareMatchRelevance(const MatchReference& a, const MatchReference& b) { using history::HistoryDatabase; +HistoryContentsProvider::HistoryContentsProvider(ACProviderListener* listener, + Profile* profile) + : AutocompleteProvider(listener, profile, "HistoryContents"), + star_title_count_(0), + star_contents_count_(0), + title_count_(0), + contents_count_(0), + input_type_(AutocompleteInput::INVALID), + trim_http_(false), + have_results_(false) { +} + void HistoryContentsProvider::Start(const AutocompleteInput& input, bool minimal_changes) { matches_.clear(); @@ -138,6 +150,9 @@ void HistoryContentsProvider::Stop() { have_results_ = false; } +HistoryContentsProvider::~HistoryContentsProvider() { +} + void HistoryContentsProvider::QueryComplete(HistoryService::Handle handle, history::QueryResults* results) { results_.AppendResultsBySwapping(results, true); diff --git a/chrome/browser/autocomplete/history_contents_provider.h b/chrome/browser/autocomplete/history_contents_provider.h index 510b5cf..31b75ec 100644 --- a/chrome/browser/autocomplete/history_contents_provider.h +++ b/chrome/browser/autocomplete/history_contents_provider.h @@ -22,16 +22,7 @@ struct TitleMatch; // This is synchronous. class HistoryContentsProvider : public AutocompleteProvider { public: - HistoryContentsProvider(ACProviderListener* listener, Profile* profile) - : AutocompleteProvider(listener, profile, "HistoryContents"), - star_title_count_(0), - star_contents_count_(0), - title_count_(0), - contents_count_(0), - input_type_(AutocompleteInput::INVALID), - trim_http_(false), - have_results_(false) { - } + HistoryContentsProvider(ACProviderListener* listener, Profile* profile); // As necessary asks the history service for the relevant results. When // done SetResults is invoked. @@ -50,7 +41,7 @@ class HistoryContentsProvider : public AutocompleteProvider { static const size_t kMaxMatchCount = 50; private: - ~HistoryContentsProvider() {} + ~HistoryContentsProvider(); void QueryComplete(HistoryService::Handle handle, history::QueryResults* results); diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index 2c67f7d..0ec478c 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -54,6 +54,14 @@ void SearchProvider::Providers::Set(const TemplateURL* default_provider, cached_keyword_provider_ = *keyword_provider; } +SearchProvider::SearchProvider(ACProviderListener* listener, Profile* profile) + : AutocompleteProvider(listener, profile, "Search"), + have_history_results_(false), + history_request_pending_(false), + suggest_results_pending_(0), + have_suggest_results_(false) { +} + void SearchProvider::Start(const AutocompleteInput& input, bool minimal_changes) { matches_.clear(); @@ -198,6 +206,9 @@ void SearchProvider::OnURLFetchComplete(const URLFetcher* source, listener_->OnProviderUpdate(!suggest_results->empty()); } +SearchProvider::~SearchProvider() { +} + void SearchProvider::StartOrStopHistoryQuery(bool minimal_changes) { // For the minimal_changes case, if we finished the previous query and still // have its results, or are allowed to keep running it, just do that, rather diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h index 02adb5c..73b70fe 100644 --- a/chrome/browser/autocomplete/search_provider.h +++ b/chrome/browser/autocomplete/search_provider.h @@ -44,13 +44,7 @@ class Value; class SearchProvider : public AutocompleteProvider, public URLFetcher::Delegate { public: - SearchProvider(ACProviderListener* listener, Profile* profile) - : AutocompleteProvider(listener, profile, "Search"), - have_history_results_(false), - history_request_pending_(false), - suggest_results_pending_(0), - have_suggest_results_(false) { - } + SearchProvider(ACProviderListener* listener, Profile* profile); #if defined(UNIT_TEST) static void set_query_suggest_immediately(bool value) { @@ -78,7 +72,7 @@ class SearchProvider : public AutocompleteProvider, static const int kKeywordProviderURLFetcherID; private: - ~SearchProvider() {} + ~SearchProvider(); // Manages the providers (TemplateURLs) used by SearchProvider. Two providers // may be used: |