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

Unified Diff: chrome/browser/autocomplete/search_provider.cc

Issue 456843003: Remove protected virtual methods from BaseSearchProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autocomplete/search_provider.h ('k') | chrome/browser/autocomplete/zero_suggest_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/search_provider.cc
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 64eec0e26d4319af46c7e73f0747367ae0ef5e80..cd2c45e24cb61dcea0f10aba38984cda42141c2c 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -250,6 +250,14 @@ void SearchProvider::Start(const AutocompleteInput& input,
UpdateMatches();
}
+void SearchProvider::Stop(bool clear_cached_results) {
+ StopSuggest();
+ done_ = true;
+
+ if (clear_cached_results)
+ ClearAllResults();
+}
+
const TemplateURL* SearchProvider::GetTemplateURL(bool is_keyword) const {
return is_keyword ? providers_.GetKeywordProviderURL()
: providers_.GetDefaultProviderURL();
@@ -265,23 +273,6 @@ bool SearchProvider::ShouldAppendExtraParams(
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::RecordDeletionResult(bool success) {
if (success) {
base::RecordAction(
@@ -324,6 +315,23 @@ void SearchProvider::OnURLFetchComplete(const net::URLFetcher* source) {
listener_->OnProviderUpdate(results_updated);
}
+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::UpdateMatchContentsClass(
const base::string16& input_text,
SearchSuggestionParser::Results* results) {
« no previous file with comments | « chrome/browser/autocomplete/search_provider.h ('k') | chrome/browser/autocomplete/zero_suggest_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698