| 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 #include "chrome/browser/search/search.h" | 5 #include "chrome/browser/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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
| 46 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" | 46 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" |
| 47 #endif // defined(OS_CHROMEOS) | 47 #endif // defined(OS_CHROMEOS) |
| 48 | 48 |
| 49 namespace search { | 49 namespace search { |
| 50 | 50 |
| 51 namespace { | 51 namespace { |
| 52 | 52 |
| 53 const char kPrefetchSearchResultsOnSRP[] = "prefetch_results_srp"; | |
| 54 const char kPrerenderInstantUrlOnOmniboxFocus[] = | 53 const char kPrerenderInstantUrlOnOmniboxFocus[] = |
| 55 "prerender_instant_url_on_omnibox_focus"; | 54 "prerender_instant_url_on_omnibox_focus"; |
| 56 | 55 |
| 57 // Controls whether to use the alternate Instant search base URL. This allows | 56 // Controls whether to use the alternate Instant search base URL. This allows |
| 58 // experimentation of Instant search. | 57 // experimentation of Instant search. |
| 59 const char kUseAltInstantURL[] = "use_alternate_instant_url"; | 58 const char kUseAltInstantURL[] = "use_alternate_instant_url"; |
| 60 const char kUseSearchPathForInstant[] = "use_search_path_for_instant"; | 59 const char kUseSearchPathForInstant[] = "use_search_path_for_instant"; |
| 61 const char kAltInstantURLPath[] = "search"; | 60 const char kAltInstantURLPath[] = "search"; |
| 62 const char kAltInstantURLQueryParams[] = "&qbp=1"; | 61 const char kAltInstantURLQueryParams[] = "&qbp=1"; |
| 63 | 62 |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 579 |
| 581 InstantSupportState GetInstantSupportStateFromNavigationEntry( | 580 InstantSupportState GetInstantSupportStateFromNavigationEntry( |
| 582 const content::NavigationEntry& entry) { | 581 const content::NavigationEntry& entry) { |
| 583 base::string16 value; | 582 base::string16 value; |
| 584 if (!entry.GetExtraData(kInstantSupportStateKey, &value)) | 583 if (!entry.GetExtraData(kInstantSupportStateKey, &value)) |
| 585 return INSTANT_SUPPORT_UNKNOWN; | 584 return INSTANT_SUPPORT_UNKNOWN; |
| 586 | 585 |
| 587 return StringToInstantSupportState(value); | 586 return StringToInstantSupportState(value); |
| 588 } | 587 } |
| 589 | 588 |
| 590 bool ShouldPrefetchSearchResultsOnSRP() { | |
| 591 FieldTrialFlags flags; | |
| 592 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( | |
| 593 kPrefetchSearchResultsOnSRP, false, flags); | |
| 594 } | |
| 595 | |
| 596 bool ShouldUseAltInstantURL() { | 589 bool ShouldUseAltInstantURL() { |
| 597 FieldTrialFlags flags; | 590 FieldTrialFlags flags; |
| 598 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( | 591 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( |
| 599 kUseAltInstantURL, false, flags); | 592 kUseAltInstantURL, false, flags); |
| 600 } | 593 } |
| 601 | 594 |
| 602 bool ShouldUseSearchPathForInstant() { | 595 bool ShouldUseSearchPathForInstant() { |
| 603 FieldTrialFlags flags; | 596 FieldTrialFlags flags; |
| 604 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( | 597 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( |
| 605 kUseSearchPathForInstant, false, flags); | 598 kUseSearchPathForInstant, false, flags); |
| 606 } | 599 } |
| 607 | 600 |
| 608 } // namespace search | 601 } // namespace search |
| OLD | NEW |