| 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 22 matching lines...) Expand all Loading... |
| 33 enum OptInState { | 33 enum OptInState { |
| 34 // The user has not manually opted in/out of InstantExtended. | 34 // The user has not manually opted in/out of InstantExtended. |
| 35 INSTANT_EXTENDED_NOT_SET, | 35 INSTANT_EXTENDED_NOT_SET, |
| 36 // The user has opted-in to InstantExtended. | 36 // The user has opted-in to InstantExtended. |
| 37 INSTANT_EXTENDED_OPT_IN, | 37 INSTANT_EXTENDED_OPT_IN, |
| 38 // The user has opted-out of InstantExtended. | 38 // The user has opted-out of InstantExtended. |
| 39 INSTANT_EXTENDED_OPT_OUT, | 39 INSTANT_EXTENDED_OPT_OUT, |
| 40 INSTANT_EXTENDED_OPT_IN_STATE_ENUM_COUNT, | 40 INSTANT_EXTENDED_OPT_IN_STATE_ENUM_COUNT, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 enum DisplaySearchButtonConditions { | |
| 44 DISPLAY_SEARCH_BUTTON_NEVER, | |
| 45 DISPLAY_SEARCH_BUTTON_FOR_STR, // STR = Search Term Replacement | |
| 46 DISPLAY_SEARCH_BUTTON_FOR_STR_OR_IIP, // IIP = Input In Progress | |
| 47 DISPLAY_SEARCH_BUTTON_ALWAYS, | |
| 48 DISPLAY_SEARCH_BUTTON_NUM_VALUES, | |
| 49 }; | |
| 50 | |
| 51 enum OriginChipCondition { | |
| 52 ORIGIN_CHIP_DISABLED = 0, | |
| 53 ORIGIN_CHIP_ALWAYS, | |
| 54 ORIGIN_CHIP_ON_SRP, | |
| 55 ORIGIN_CHIP_NUM_VALUES, | |
| 56 }; | |
| 57 | |
| 58 // Use this value for "start margin" to prevent the "es_sm" parameter from | 43 // Use this value for "start margin" to prevent the "es_sm" parameter from |
| 59 // being used. | 44 // being used. |
| 60 extern const int kDisableStartMargin; | 45 extern const int kDisableStartMargin; |
| 61 | 46 |
| 62 // Returns whether the suggest is enabled for the given |profile|. | 47 // Returns whether the suggest is enabled for the given |profile|. |
| 63 bool IsSuggestPrefEnabled(Profile* profile); | 48 bool IsSuggestPrefEnabled(Profile* profile); |
| 64 | 49 |
| 65 // Returns a string indicating whether InstantExtended is enabled, suitable | 50 // Returns a string indicating whether InstantExtended is enabled, suitable |
| 66 // for adding as a query string param to the homepage or search requests. | 51 // for adding as a query string param to the homepage or search requests. |
| 67 // Returns an empty string otherwise. | 52 // Returns an empty string otherwise. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 bool ShouldPrerenderInstantUrlOnOmniboxFocus(); | 156 bool ShouldPrerenderInstantUrlOnOmniboxFocus(); |
| 172 | 157 |
| 173 // Returns true if 'reuse_instant_search_base_page' flag is set to true in field | 158 // Returns true if 'reuse_instant_search_base_page' flag is set to true in field |
| 174 // trials to reuse the prerendered page to commit any search query. | 159 // trials to reuse the prerendered page to commit any search query. |
| 175 bool ShouldReuseInstantSearchBasePage(); | 160 bool ShouldReuseInstantSearchBasePage(); |
| 176 | 161 |
| 177 // Returns the Local Instant URL of the New Tab Page. | 162 // Returns the Local Instant URL of the New Tab Page. |
| 178 // TODO(kmadhusu): Remove this function and update the call sites. | 163 // TODO(kmadhusu): Remove this function and update the call sites. |
| 179 GURL GetLocalInstantURL(Profile* profile); | 164 GURL GetLocalInstantURL(Profile* profile); |
| 180 | 165 |
| 181 // Returns when we should show a search button in the omnibox. This may be any | |
| 182 // of several values, some of which depend on whether the underlying state of | |
| 183 // the page would normally be to perform search term replacement; see also | |
| 184 // ToolbarModel::WouldPerformSearchTermReplacement(). | |
| 185 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); | |
| 186 | |
| 187 // Returns true if the origin chip should be shown. | |
| 188 bool ShouldDisplayOriginChip(); | |
| 189 | |
| 190 // Returns a value indicating when the origin chip should be shown. | |
| 191 OriginChipCondition GetOriginChipCondition(); | |
| 192 | |
| 193 // Returns true if the local new tab page should show a Google logo and search | 166 // Returns true if the local new tab page should show a Google logo and search |
| 194 // box for users whose default search provider is Google, or false if not. | 167 // box for users whose default search provider is Google, or false if not. |
| 195 bool ShouldShowGoogleLocalNTP(); | 168 bool ShouldShowGoogleLocalNTP(); |
| 196 | 169 |
| 197 // Transforms the input |url| into its "effective URL". The returned URL | 170 // Transforms the input |url| into its "effective URL". The returned URL |
| 198 // facilitates grouping process-per-site. The |url| is transformed, for | 171 // facilitates grouping process-per-site. The |url| is transformed, for |
| 199 // example, from | 172 // example, from |
| 200 // | 173 // |
| 201 // https://www.google.com/search?espv=1&q=tractors | 174 // https://www.google.com/search?espv=1&q=tractors |
| 202 // | 175 // |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 226 |
| 254 // Returns true if 'use_search_path_for_instant' flag is set to true in field | 227 // Returns true if 'use_search_path_for_instant' flag is set to true in field |
| 255 // trials to use an '/search' path in an alternate Instant search base page URL | 228 // trials to use an '/search' path in an alternate Instant search base page URL |
| 256 // for prefetching search results. This allows experimentation of Instant | 229 // for prefetching search results. This allows experimentation of Instant |
| 257 // search. | 230 // search. |
| 258 bool ShouldUseSearchPathForInstant(); | 231 bool ShouldUseSearchPathForInstant(); |
| 259 | 232 |
| 260 } // namespace chrome | 233 } // namespace chrome |
| 261 | 234 |
| 262 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 235 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
| OLD | NEW |