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

Side by Side Diff: components/omnibox/browser/zero_suggest_provider.h

Issue 2724303002: Omnibox - Zero Suggest - Log When/Whether Contextual Search is Possible (Closed)
Patch Set: pkasting's comments, plus improve metrics description Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/omnibox/browser/zero_suggest_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains the zero-suggest autocomplete provider. This experimental 5 // This file contains the zero-suggest autocomplete provider. This experimental
6 // provider is invoked when the user focuses in the omnibox prior to editing, 6 // provider is invoked when the user focuses in the omnibox prior to editing,
7 // and generates search query suggestions based on the current URL. 7 // and generates search query suggestions based on the current URL.
8 8
9 #ifndef COMPONENTS_OMNIBOX_BROWSER_ZERO_SUGGEST_PROVIDER_H_ 9 #ifndef COMPONENTS_OMNIBOX_BROWSER_ZERO_SUGGEST_PROVIDER_H_
10 #define COMPONENTS_OMNIBOX_BROWSER_ZERO_SUGGEST_PROVIDER_H_ 10 #define COMPONENTS_OMNIBOX_BROWSER_ZERO_SUGGEST_PROVIDER_H_
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // service for the most visited URLs during Run(). It calls back to this 115 // service for the most visited URLs during Run(). It calls back to this
116 // function to return those |urls|. 116 // function to return those |urls|.
117 void OnMostVisitedUrlsAvailable(const history::MostVisitedURLList& urls); 117 void OnMostVisitedUrlsAvailable(const history::MostVisitedURLList& urls);
118 118
119 // Whether we can show zero suggest without sending |current_page_url| to 119 // Whether we can show zero suggest without sending |current_page_url| to
120 // |suggest_url| search provider. Also checks that other conditions for 120 // |suggest_url| search provider. Also checks that other conditions for
121 // non-contextual zero suggest are satisfied. 121 // non-contextual zero suggest are satisfied.
122 bool ShouldShowNonContextualZeroSuggest(const GURL& suggest_url, 122 bool ShouldShowNonContextualZeroSuggest(const GURL& suggest_url,
123 const GURL& current_page_url) const; 123 const GURL& current_page_url) const;
124 124
125 // Returns a URL string that should be used to to request contextual
126 // suggestions from the default provider. Does not take into account whether
127 // sending this request is prohibited (e.g., in an incognito window). Returns
128 // an empty string in case of an error.
129 std::string GetContextualSuggestionsUrl() const;
130
125 // Checks whether we have a set of zero suggest results cached, and if so 131 // Checks whether we have a set of zero suggest results cached, and if so
126 // populates |matches_| with cached results. 132 // populates |matches_| with cached results.
127 void MaybeUseCachedSuggestions(); 133 void MaybeUseCachedSuggestions();
128 134
129 // Used for efficiency when creating the verbatim match. Can be null. 135 // Used for efficiency when creating the verbatim match. Can be null.
130 HistoryURLProvider* history_url_provider_; 136 HistoryURLProvider* history_url_provider_;
131 137
132 AutocompleteProviderListener* listener_; 138 AutocompleteProviderListener* listener_;
133 139
134 // The URL for which a suggestion fetch is pending. 140 // The URL for which a suggestion fetch is pending.
(...skipping 24 matching lines...) Expand all
159 // Whether we are waiting for a most visited visited urls callback to run. 165 // Whether we are waiting for a most visited visited urls callback to run.
160 bool waiting_for_most_visited_urls_request_; 166 bool waiting_for_most_visited_urls_request_;
161 167
162 // For callbacks that may be run after destruction. 168 // For callbacks that may be run after destruction.
163 base::WeakPtrFactory<ZeroSuggestProvider> weak_ptr_factory_; 169 base::WeakPtrFactory<ZeroSuggestProvider> weak_ptr_factory_;
164 170
165 DISALLOW_COPY_AND_ASSIGN(ZeroSuggestProvider); 171 DISALLOW_COPY_AND_ASSIGN(ZeroSuggestProvider);
166 }; 172 };
167 173
168 #endif // COMPONENTS_OMNIBOX_BROWSER_ZERO_SUGGEST_PROVIDER_H_ 174 #endif // COMPONENTS_OMNIBOX_BROWSER_ZERO_SUGGEST_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | components/omnibox/browser/zero_suggest_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698