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