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

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: Revert getters 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 04b37a5a6092bfdf1c01e92a91d7a21963d3a863..9e4409a5d1c133a90a92efe5b987a881926ebf9a 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() {
Peter Kasting 2014/08/13 17:33:45 Nit: You still haven't inlined these two functions
hashimoto 2014/08/14 03:52:09 Sorry to not mentioning this. StopSuggest() and Cl
+ // 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