OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CHROME_BROWSER_SEARCH_SEARCH_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_SEARCH_H_ |
6 #define CHROME_BROWSER_SEARCH_SEARCH_H_ | 6 #define CHROME_BROWSER_SEARCH_SEARCH_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // Same as IsInstantNTP but uses |nav_entry| to determine the URL for the page | 142 // Same as IsInstantNTP but uses |nav_entry| to determine the URL for the page |
143 // instead of using the visible entry. | 143 // instead of using the visible entry. |
144 bool NavEntryIsInstantNTP(const content::WebContents* contents, | 144 bool NavEntryIsInstantNTP(const content::WebContents* contents, |
145 const content::NavigationEntry* nav_entry); | 145 const content::NavigationEntry* nav_entry); |
146 | 146 |
147 // Returns the Instant URL of the default search engine. Returns an empty GURL | 147 // Returns the Instant URL of the default search engine. Returns an empty GURL |
148 // if the engine doesn't have an Instant URL, or if it shouldn't be used (say | 148 // if the engine doesn't have an Instant URL, or if it shouldn't be used (say |
149 // because it doesn't satisfy the requirements for extended mode or if Instant | 149 // because it doesn't satisfy the requirements for extended mode or if Instant |
150 // is disabled through preferences). Callers must check that the returned URL is | 150 // is disabled through preferences). Callers must check that the returned URL is |
151 // valid before using it. The value of |start_margin| is used for the "es_sm" | 151 // valid before using it. |force_instant_results| forces a search page to update |
152 // parameter in the URL. |force_instant_results| forces a search page to update | |
153 // results incrementally even if that is otherwise disabled by google.com | 152 // results incrementally even if that is otherwise disabled by google.com |
154 // preferences. | 153 // preferences. |
155 // NOTE: This method expands the default search engine's instant_url template, | 154 // NOTE: This method expands the default search engine's instant_url template, |
156 // so it shouldn't be called from SearchTermsData or other such code that would | 155 // so it shouldn't be called from SearchTermsData or other such code that would |
157 // lead to an infinite recursion. | 156 // lead to an infinite recursion. |
158 GURL GetInstantURL(Profile* profile, | 157 GURL GetInstantURL(Profile* profile, bool force_instant_results); |
159 int start_margin, | |
160 bool force_instant_results); | |
161 | 158 |
162 // Returns URLs associated with the default search engine for |profile|. | 159 // Returns URLs associated with the default search engine for |profile|. |
163 std::vector<GURL> GetSearchURLs(Profile* profile); | 160 std::vector<GURL> GetSearchURLs(Profile* profile); |
164 | 161 |
165 // Returns the default search engine base page URL to prefetch search results. | 162 // Returns the default search engine base page URL to prefetch search results. |
166 // Returns an empty URL if 'prefetch_results' flag is set to false in field | 163 // Returns an empty URL if 'prefetch_results' flag is set to false in field |
167 // trials. | 164 // trials. |
168 GURL GetSearchResultPrefetchBaseURL(Profile* profile); | 165 GURL GetSearchResultPrefetchBaseURL(Profile* profile); |
169 | 166 |
170 // Returns true if 'prefetch_results' flag is set to true in field trials to | 167 // Returns true if 'prefetch_results' flag is set to true in field trials to |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 GURL GetNewTabPageURL(Profile* profile); | 292 GURL GetNewTabPageURL(Profile* profile); |
296 | 293 |
297 // Returns true if 'use_alternate_instant_url' flag is set to true in field | 294 // Returns true if 'use_alternate_instant_url' flag is set to true in field |
298 // trials to use an alternate Instant search base page URL for prefetching | 295 // trials to use an alternate Instant search base page URL for prefetching |
299 // search results. This allows experimentation of Instant search. | 296 // search results. This allows experimentation of Instant search. |
300 bool ShouldUseAltInstantURL(); | 297 bool ShouldUseAltInstantURL(); |
301 | 298 |
302 } // namespace chrome | 299 } // namespace chrome |
303 | 300 |
304 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 301 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
OLD | NEW |