| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 576 |
| 578 InstantSupportState GetInstantSupportStateFromNavigationEntry( | 577 InstantSupportState GetInstantSupportStateFromNavigationEntry( |
| 579 const content::NavigationEntry& entry) { | 578 const content::NavigationEntry& entry) { |
| 580 base::string16 value; | 579 base::string16 value; |
| 581 if (!entry.GetExtraData(kInstantSupportStateKey, &value)) | 580 if (!entry.GetExtraData(kInstantSupportStateKey, &value)) |
| 582 return INSTANT_SUPPORT_UNKNOWN; | 581 return INSTANT_SUPPORT_UNKNOWN; |
| 583 | 582 |
| 584 return StringToInstantSupportState(value); | 583 return StringToInstantSupportState(value); |
| 585 } | 584 } |
| 586 | 585 |
| 587 bool ShouldPrefetchSearchResultsOnSRP() { | |
| 588 FieldTrialFlags flags; | |
| 589 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( | |
| 590 kPrefetchSearchResultsOnSRP, false, flags); | |
| 591 } | |
| 592 | |
| 593 bool ShouldUseAltInstantURL() { | 586 bool ShouldUseAltInstantURL() { |
| 594 FieldTrialFlags flags; | 587 FieldTrialFlags flags; |
| 595 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( | 588 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( |
| 596 kUseAltInstantURL, false, flags); | 589 kUseAltInstantURL, false, flags); |
| 597 } | 590 } |
| 598 | 591 |
| 599 bool ShouldUseSearchPathForInstant() { | 592 bool ShouldUseSearchPathForInstant() { |
| 600 FieldTrialFlags flags; | 593 FieldTrialFlags flags; |
| 601 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( | 594 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault( |
| 602 kUseSearchPathForInstant, false, flags); | 595 kUseSearchPathForInstant, false, flags); |
| 603 } | 596 } |
| 604 | 597 |
| 605 } // namespace search | 598 } // namespace search |
| OLD | NEW |