summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/autocomplete/autocomplete_controller.cc2
-rw-r--r--chrome/browser/autocomplete/autocomplete_provider.cc4
-rw-r--r--chrome/browser/autocomplete/autocomplete_provider.h5
-rw-r--r--chrome/browser/autocomplete/history_contents_provider.cc10
-rw-r--r--chrome/browser/autocomplete/history_contents_provider.h2
-rw-r--r--chrome/browser/autocomplete/history_url_provider.cc4
-rw-r--r--chrome/browser/autocomplete/history_url_provider.h2
-rw-r--r--chrome/browser/autocomplete/keyword_provider.cc2
-rw-r--r--chrome/browser/autocomplete/keyword_provider.h2
-rw-r--r--chrome/browser/autocomplete/search_provider.cc13
-rw-r--r--chrome/browser/autocomplete/search_provider.h2
-rw-r--r--chrome/browser/ui/views/ash/app_list/search_builder.cc2
12 files changed, 27 insertions, 23 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_controller.cc b/chrome/browser/autocomplete/autocomplete_controller.cc
index 039c312..8bfa351 100644
--- a/chrome/browser/autocomplete/autocomplete_controller.cc
+++ b/chrome/browser/autocomplete/autocomplete_controller.cc
@@ -176,7 +176,7 @@ void AutocompleteController::Start(
void AutocompleteController::Stop(bool clear_result) {
for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end();
++i) {
- (*i)->Stop();
+ (*i)->Stop(clear_result);
}
expire_timer_.Stop();
diff --git a/chrome/browser/autocomplete/autocomplete_provider.cc b/chrome/browser/autocomplete/autocomplete_provider.cc
index f83e8b2..5c3b8d0 100644
--- a/chrome/browser/autocomplete/autocomplete_provider.cc
+++ b/chrome/browser/autocomplete/autocomplete_provider.cc
@@ -30,7 +30,7 @@ AutocompleteProvider::AutocompleteProvider(
name_(name) {
}
-void AutocompleteProvider::Stop() {
+void AutocompleteProvider::Stop(bool clear_cached_results) {
done_ = true;
}
@@ -76,7 +76,7 @@ string16 AutocompleteProvider::StringForURLDisplay(const GURL& url,
}
AutocompleteProvider::~AutocompleteProvider() {
- Stop();
+ Stop(false);
}
// static
diff --git a/chrome/browser/autocomplete/autocomplete_provider.h b/chrome/browser/autocomplete/autocomplete_provider.h
index 665344f..5b2066d 100644
--- a/chrome/browser/autocomplete/autocomplete_provider.h
+++ b/chrome/browser/autocomplete/autocomplete_provider.h
@@ -198,8 +198,9 @@ class AutocompleteProvider
// Called when a provider must not make any more callbacks for the current
// query. This will be called regardless of whether the provider is already
- // done.
- virtual void Stop();
+ // done. If the provider caches any results, it should clear the cache based
+ // on the value of |clear_cached_results|.
+ virtual void Stop(bool clear_cached_results);
// Returns the set of matches for the current query.
const ACMatches& matches() const { return matches_; }
diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc
index 616d29b..1f7a5e0 100644
--- a/chrome/browser/autocomplete/history_contents_provider.cc
+++ b/chrome/browser/autocomplete/history_contents_provider.cc
@@ -72,7 +72,7 @@ void HistoryContentsProvider::Start(const AutocompleteInput& input,
!(HistoryServiceFactory::GetForProfile(profile_,
Profile::EXPLICIT_ACCESS) ||
profile_->GetBookmarkModel())) {
- Stop();
+ Stop(false);
return;
}
@@ -83,13 +83,13 @@ void HistoryContentsProvider::Start(const AutocompleteInput& input,
(((input.type() == AutocompleteInput::REQUESTED_URL) ||
(input.type() == AutocompleteInput::UNKNOWN)) &&
(input.text().find('.') != string16::npos))) {
- Stop();
+ Stop(false);
return;
}
if (input.matches_requested() == AutocompleteInput::BEST_MATCH) {
// None of our results are applicable for best match.
- Stop();
+ Stop(false);
return;
}
@@ -100,7 +100,7 @@ void HistoryContentsProvider::Start(const AutocompleteInput& input,
// Decide what to do about any previous query/results.
if (!minimal_changes) {
// Any in-progress request is irrelevant, cancel it.
- Stop();
+ Stop(false);
} else if (have_results_) {
// We finished the previous query and still have its results. Mark them up
// again for the new input.
@@ -150,7 +150,7 @@ void HistoryContentsProvider::Start(const AutocompleteInput& input,
}
}
-void HistoryContentsProvider::Stop() {
+void HistoryContentsProvider::Stop(bool clear_cached_results) {
done_ = true;
request_consumer_.CancelAllRequests();
diff --git a/chrome/browser/autocomplete/history_contents_provider.h b/chrome/browser/autocomplete/history_contents_provider.h
index 4e8d096..b3667d1 100644
--- a/chrome/browser/autocomplete/history_contents_provider.h
+++ b/chrome/browser/autocomplete/history_contents_provider.h
@@ -34,7 +34,7 @@ class HistoryContentsProvider : public HistoryProvider {
// done SetResults is invoked.
virtual void Start(const AutocompleteInput& input,
bool minimal_changes) OVERRIDE;
- virtual void Stop() OVERRIDE;
+ virtual void Stop(bool clear_cached_results) OVERRIDE;
private:
// When processing the results from the history query, this structure points
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index d68220b..b18b27b 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -306,12 +306,12 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
// re-run the query from scratch and ignore |minimal_changes|.
// Cancel any in-progress query.
- Stop();
+ Stop(false);
RunAutocompletePasses(input, true);
}
-void HistoryURLProvider::Stop() {
+void HistoryURLProvider::Stop(bool clear_cached_results) {
done_ = true;
if (params_)
diff --git a/chrome/browser/autocomplete/history_url_provider.h b/chrome/browser/autocomplete/history_url_provider.h
index 3258519..7f46684 100644
--- a/chrome/browser/autocomplete/history_url_provider.h
+++ b/chrome/browser/autocomplete/history_url_provider.h
@@ -158,7 +158,7 @@ class HistoryURLProvider : public HistoryProvider {
// AutocompleteProvider
virtual void Start(const AutocompleteInput& input,
bool minimal_changes) OVERRIDE;
- virtual void Stop() OVERRIDE;
+ virtual void Stop(bool clear_cached_results) OVERRIDE;
// Runs the history query on the history thread, called by the history
// system. The history database MAY BE NULL in which case it is not
diff --git a/chrome/browser/autocomplete/keyword_provider.cc b/chrome/browser/autocomplete/keyword_provider.cc
index bad8127..76df0c1 100644
--- a/chrome/browser/autocomplete/keyword_provider.cc
+++ b/chrome/browser/autocomplete/keyword_provider.cc
@@ -339,7 +339,7 @@ void KeywordProvider::Start(const AutocompleteInput& input,
}
}
-void KeywordProvider::Stop() {
+void KeywordProvider::Stop(bool clear_cached_results) {
done_ = true;
MaybeEndExtensionKeywordMode();
}
diff --git a/chrome/browser/autocomplete/keyword_provider.h b/chrome/browser/autocomplete/keyword_provider.h
index 1e93884..f92f9d3 100644
--- a/chrome/browser/autocomplete/keyword_provider.h
+++ b/chrome/browser/autocomplete/keyword_provider.h
@@ -91,7 +91,7 @@ class KeywordProvider : public AutocompleteProvider,
// AutocompleteProvider:
virtual void Start(const AutocompleteInput& input,
bool minimal_changes) OVERRIDE;
- virtual void Stop() OVERRIDE;
+ virtual void Stop(bool clear_cached_results) OVERRIDE;
private:
class ScopedEndExtensionKeywordMode;
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 5b85fbe..8bd2c9f 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -189,7 +189,7 @@ void SearchProvider::Start(const AutocompleteInput& input,
// Can't return search/suggest results for bogus input or without a profile.
if (!profile_ || (input.type() == AutocompleteInput::INVALID)) {
- Stop();
+ Stop(false);
return;
}
@@ -212,7 +212,7 @@ void SearchProvider::Start(const AutocompleteInput& input,
if (!default_provider && !keyword_provider) {
// No valid providers.
- Stop();
+ Stop(false);
return;
}
@@ -227,7 +227,7 @@ void SearchProvider::Start(const AutocompleteInput& input,
if (done_)
default_provider_suggest_text_.clear();
else
- Stop();
+ Stop(false);
}
providers_.set(default_provider_keyword, keyword_provider_keyword);
@@ -244,7 +244,7 @@ void SearchProvider::Start(const AutocompleteInput& input,
match.keyword = providers_.default_provider();
matches_.push_back(match);
}
- Stop();
+ Stop(false);
return;
}
@@ -313,10 +313,13 @@ void SearchProvider::Run() {
}
}
-void SearchProvider::Stop() {
+void SearchProvider::Stop(bool clear_cached_results) {
StopSuggest();
done_ = true;
default_provider_suggest_text_.clear();
+
+ if (clear_cached_results)
+ ClearResults();
}
void SearchProvider::AddProviderInfo(ProvidersInfo* provider_info) const {
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h
index 2d02bd2..5063157 100644
--- a/chrome/browser/autocomplete/search_provider.h
+++ b/chrome/browser/autocomplete/search_provider.h
@@ -72,7 +72,7 @@ class SearchProvider : public AutocompleteProvider,
// AutocompleteProvider:
virtual void Start(const AutocompleteInput& input,
bool minimal_changes) OVERRIDE;
- virtual void Stop() OVERRIDE;
+ virtual void Stop(bool clear_cached_results) OVERRIDE;
// Adds search-provider-specific information to omnibox event logs.
virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE;
diff --git a/chrome/browser/ui/views/ash/app_list/search_builder.cc b/chrome/browser/ui/views/ash/app_list/search_builder.cc
index 4310cae..ce0374f 100644
--- a/chrome/browser/ui/views/ash/app_list/search_builder.cc
+++ b/chrome/browser/ui/views/ash/app_list/search_builder.cc
@@ -223,7 +223,7 @@ void SearchBuilder::StopSearch() {
if (controller_.get())
controller_->Stop(true);
else
- apps_provider_->Stop();
+ apps_provider_->Stop(true);
}
void SearchBuilder::OpenResult(const app_list::SearchResult& result,