Part 5 of search provider refactoring.
Factor out a shared Stop() method into superclass. The method is
public because AutocompleteController calls Stop() on
zero_suggest_provider. There is no change to functionality.
BUG=338955
TBR=mpearson
Review URL: https://codereview.chromium.org/158223002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251746 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 25d08c0..331a498 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -404,14 +404,6 @@
UpdateMatches();
}
-void SearchProvider::Stop(bool clear_cached_results) {
- StopSuggest();
- done_ = true;
-
- if (clear_cached_results)
- ClearAllResults();
-}
-
void SearchProvider::OnURLFetchComplete(const net::URLFetcher* source) {
DCHECK(!done_);
suggest_results_pending_--;
@@ -493,6 +485,23 @@
providers_.default_provider().empty();
}
+void SearchProvider::StopSuggest() {
+ // Increment the appropriate field in the histogram by the number of
+ // pending requests that were invalidated.
+ for (int i = 0; i < suggest_results_pending_; ++i)
+ LogOmniboxSuggestRequest(REQUEST_INVALIDATED);
+ suggest_results_pending_ = 0;
+ timer_.Stop();
+ // Stop any in-progress URL fetches.
+ keyword_fetcher_.reset();
+ default_fetcher_.reset();
+}
+
+void SearchProvider::ClearAllResults() {
+ keyword_results_.Clear();
+ default_results_.Clear();
+}
+
void SearchProvider::OnDeletionComplete(bool success,
SuggestionDeletionHandler* handler) {
RecordDeletionResult(success);
@@ -711,23 +720,6 @@
return true;
}
-void SearchProvider::StopSuggest() {
- // Increment the appropriate field in the histogram by the number of
- // pending requests that were invalidated.
- for (int i = 0; i < suggest_results_pending_; i++)
- LogOmniboxSuggestRequest(REQUEST_INVALIDATED);
- suggest_results_pending_ = 0;
- timer_.Stop();
- // Stop any in-progress URL fetches.
- keyword_fetcher_.reset();
- default_fetcher_.reset();
-}
-
-void SearchProvider::ClearAllResults() {
- keyword_results_.Clear();
- default_results_.Clear();
-}
-
void SearchProvider::RemoveAllStaleResults() {
// We only need to remove stale results (which ensures the top-scoring
// match is inlineable) if the user is not in reorder mode. In reorder