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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 uint64 EmbeddedSearchPageVersion(); | 79 uint64 EmbeddedSearchPageVersion(); |
80 | 80 |
81 // Returns a string indicating whether InstantExtended is enabled, suitable | 81 // Returns a string indicating whether InstantExtended is enabled, suitable |
82 // for adding as a query string param to the homepage or search requests. | 82 // for adding as a query string param to the homepage or search requests. |
83 // Returns an empty string otherwise. | 83 // Returns an empty string otherwise. |
84 // | 84 // |
85 // |for_search| should be set to true for search requests, in which case this | 85 // |for_search| should be set to true for search requests, in which case this |
86 // returns a non-empty string only if query extraction is enabled. | 86 // returns a non-empty string only if query extraction is enabled. |
87 std::string InstantExtendedEnabledParam(bool for_search); | 87 std::string InstantExtendedEnabledParam(bool for_search); |
88 | 88 |
| 89 // Returns a string that will cause the search results page to update |
| 90 // incrementally. Currently, Instant Extended passes a different param to |
| 91 // search results pages that also has this effect, so by default this function |
| 92 // returns the empty string when Instant Extended is enabled. However, when |
| 93 // doing instant search result prerendering, we still need to pass this param, |
| 94 // as Instant Extended does not cause incremental updates by default for the |
| 95 // prerender page. Callers should set |for_prerender| in this case to force |
| 96 // the returned string to be non-empty. |
| 97 std::string ForceInstantResultsParam(bool for_prerender); |
| 98 |
89 // Returns whether query extraction is enabled. | 99 // Returns whether query extraction is enabled. |
90 bool IsQueryExtractionEnabled(); | 100 bool IsQueryExtractionEnabled(); |
91 | 101 |
92 // Extracts and returns search terms from |url|. Does not consider | 102 // Extracts and returns search terms from |url|. Does not consider |
93 // IsQueryExtractionEnabled() and Instant support state of the page and does | 103 // IsQueryExtractionEnabled() and Instant support state of the page and does |
94 // not check for a privileged process, so most callers should use | 104 // not check for a privileged process, so most callers should use |
95 // GetSearchTerms() below instead. | 105 // GetSearchTerms() below instead. |
96 base::string16 ExtractSearchTermsFromURL(Profile* profile, const GURL& url); | 106 base::string16 ExtractSearchTermsFromURL(Profile* profile, const GURL& url); |
97 | 107 |
98 // Returns true if it is okay to extract search terms from |url|. |url| must | 108 // Returns true if it is okay to extract search terms from |url|. |url| must |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 bool GetBoolValueForFlagWithDefault(const std::string& flag, | 296 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
287 bool default_value, | 297 bool default_value, |
288 const FieldTrialFlags& flags); | 298 const FieldTrialFlags& flags); |
289 | 299 |
290 // Returns the Cacheable New Tab Page URL for the given |profile|. | 300 // Returns the Cacheable New Tab Page URL for the given |profile|. |
291 GURL GetNewTabPageURL(Profile* profile); | 301 GURL GetNewTabPageURL(Profile* profile); |
292 | 302 |
293 } // namespace chrome | 303 } // namespace chrome |
294 | 304 |
295 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 305 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
OLD | NEW |