| 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) {
|
|
|