OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SEARCH_SEARCH_H_ | 5 #ifndef COMPONENTS_SEARCH_SEARCH_H_ |
6 #define COMPONENTS_SEARCH_SEARCH_H_ | 6 #define COMPONENTS_SEARCH_SEARCH_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Returns a string that will cause the search results page to update | 70 // Returns a string that will cause the search results page to update |
71 // incrementally. Currently, Instant Extended passes a different param to | 71 // incrementally. Currently, Instant Extended passes a different param to |
72 // search results pages that also has this effect, so by default this function | 72 // search results pages that also has this effect, so by default this function |
73 // returns the empty string when Instant Extended is enabled. However, when | 73 // returns the empty string when Instant Extended is enabled. However, when |
74 // doing instant search result prerendering, we still need to pass this param, | 74 // doing instant search result prerendering, we still need to pass this param, |
75 // as Instant Extended does not cause incremental updates by default for the | 75 // as Instant Extended does not cause incremental updates by default for the |
76 // prerender page. Callers should set |for_prerender| in this case to force | 76 // prerender page. Callers should set |for_prerender| in this case to force |
77 // the returned string to be non-empty. | 77 // the returned string to be non-empty. |
78 std::string ForceInstantResultsParam(bool for_prerender); | 78 std::string ForceInstantResultsParam(bool for_prerender); |
79 | 79 |
80 // Returns whether query extraction is enabled. | |
81 bool IsQueryExtractionEnabled(); | |
82 | |
83 // Returns true if 'prefetch_results' flag is set to true in field trials to | 80 // Returns true if 'prefetch_results' flag is set to true in field trials to |
84 // prefetch high-confidence search suggestions. | 81 // prefetch high-confidence search suggestions. |
85 bool ShouldPrefetchSearchResults(); | 82 bool ShouldPrefetchSearchResults(); |
86 | 83 |
87 // Returns true if 'reuse_instant_search_base_page' flag is set to true in field | 84 // Returns true if 'reuse_instant_search_base_page' flag is set to true in field |
88 // trials to reuse the prerendered page to commit any search query. | 85 // trials to reuse the prerendered page to commit any search query. |
89 bool ShouldReuseInstantSearchBasePage(); | 86 bool ShouldReuseInstantSearchBasePage(); |
90 | 87 |
91 // |url| should either have a secure scheme or have a non-HTTPS base URL that | 88 // |url| should either have a secure scheme or have a non-HTTPS base URL that |
92 // the user specified using --google-base-url. (This allows testers to use | 89 // the user specified using --google-base-url. (This allows testers to use |
93 // --google-base-url to point at non-HTTPS servers, which eases testing.) | 90 // --google-base-url to point at non-HTTPS servers, which eases testing.) |
94 bool IsSuitableURLForInstant(const GURL& url, const TemplateURL* template_url); | 91 bool IsSuitableURLForInstant(const GURL& url, const TemplateURL* template_url); |
95 | 92 |
96 // ----------------------------------------------------- | |
97 // The following APIs are exposed for use in tests only. | |
98 // ----------------------------------------------------- | |
99 | |
100 // Forces query in the omnibox to be on for tests. | |
101 void EnableQueryExtractionForTesting(); | |
102 | |
103 } // namespace search | 93 } // namespace search |
104 | 94 |
105 #endif // COMPONENTS_SEARCH_SEARCH_H_ | 95 #endif // COMPONENTS_SEARCH_SEARCH_H_ |
OLD | NEW |