| 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 #include "components/search/search.h" | 5 #include "components/search/search.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #if defined(OS_ANDROID) | 64 #if defined(OS_ANDROID) |
| 65 const char kPrefetchSearchResultsFlagName[] = "prefetch_results"; | 65 const char kPrefetchSearchResultsFlagName[] = "prefetch_results"; |
| 66 | 66 |
| 67 // Controls whether to reuse prerendered Instant Search base page to commit any | 67 // Controls whether to reuse prerendered Instant Search base page to commit any |
| 68 // search query. | 68 // search query. |
| 69 const char kReuseInstantSearchBasePage[] = "reuse_instant_search_base_page"; | 69 const char kReuseInstantSearchBasePage[] = "reuse_instant_search_base_page"; |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 } // namespace | 72 } // namespace |
| 73 | 73 |
| 74 // Negative start-margin values prevent the "es_sm" parameter from being used. | |
| 75 const int kDisableStartMargin = -1; | |
| 76 | |
| 77 bool IsInstantExtendedAPIEnabled() { | 74 bool IsInstantExtendedAPIEnabled() { |
| 78 #if defined(OS_IOS) | 75 #if defined(OS_IOS) |
| 79 return false; | 76 return false; |
| 80 #elif defined(OS_ANDROID) | 77 #elif defined(OS_ANDROID) |
| 81 return EmbeddedSearchPageVersion() == kEmbeddedSearchEnabledVersion; | 78 return EmbeddedSearchPageVersion() == kEmbeddedSearchEnabledVersion; |
| 82 #else | 79 #else |
| 83 return true; | 80 return true; |
| 84 #endif // defined(OS_IOS) | 81 #endif // defined(OS_IOS) |
| 85 } | 82 } |
| 86 | 83 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 248 } |
| 252 | 249 |
| 253 void EnableQueryExtractionForTesting() { | 250 void EnableQueryExtractionForTesting() { |
| 254 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 251 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
| 255 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | 252 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); |
| 256 cl->AppendSwitch(switches::kEnableQueryExtraction); | 253 cl->AppendSwitch(switches::kEnableQueryExtraction); |
| 257 #endif | 254 #endif |
| 258 } | 255 } |
| 259 | 256 |
| 260 } // namespace search | 257 } // namespace search |
| OLD | NEW |