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

Unified Diff: chrome/browser/autocomplete/zero_suggest_provider.h

Issue 671593002: Do not delay most visited results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed slow mv return condition and added unit tests Created 6 years, 2 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
Index: chrome/browser/autocomplete/zero_suggest_provider.h
diff --git a/chrome/browser/autocomplete/zero_suggest_provider.h b/chrome/browser/autocomplete/zero_suggest_provider.h
index aaeaa6f88251564efd9f2933ddc06e6b178439b0..3e2e95576df1dd87c0bc00d05a54fb63b3b2aa69 100644
--- a/chrome/browser/autocomplete/zero_suggest_provider.h
+++ b/chrome/browser/autocomplete/zero_suggest_provider.h
@@ -119,10 +119,11 @@ class ZeroSuggestProvider : public BaseSearchProvider,
// Returns the relevance score for the verbatim result.
int GetVerbatimRelevance() const;
- // Whether we can show zero suggest on |current_page_url| without
- // sending |current_page_url| as a parameter to the server at |suggest_url|.
- bool CanShowZeroSuggestWithoutSendingURL(const GURL& suggest_url,
- const GURL& current_page_url) const;
+ // Whether we can show zero suggest without sending |current_page_url| to
+ // |suggest_url| search provider. Also checks that other conditions for
+ // non-contextual zero suggest are satisfied.
+ bool ShouldShowNonContextualZeroSuggest(const GURL& suggest_url,
+ const GURL& current_page_url) const;
// Checks whether we have a set of zero suggest results cached, and if so
// populates |matches_| with cached results.
@@ -156,6 +157,9 @@ class ZeroSuggestProvider : public BaseSearchProvider,
history::MostVisitedURLList most_visited_urls_;
+ // Whether we are waiting for a most visited visited urls callback to run.
+ bool most_visited_urls_requested_;
Mark P 2014/10/22 19:11:23 optional nit: consider calling this something like
Maria 2014/10/23 20:34:26 Done.
+
// For callbacks that may be run after destruction.
base::WeakPtrFactory<ZeroSuggestProvider> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698