Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: chrome/browser/search/search.cc

Issue 360373006: Enable prefetch-search-results on Desktop Chrome by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added DCHECK Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/search/instant_service_unittest.cc ('k') | chrome/browser/search/search_android_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index d473454fd0b7e1adbbf0fc12e4d97ddd9d19634c..69471356138680c81bb269f5372d92935467c97c 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -65,15 +65,18 @@ const uint64 kEmbeddedPageVersionDefault = 2;
#endif
const char kHideVerbatimFlagName[] = "hide_verbatim";
-const char kPrefetchSearchResultsFlagName[] = "prefetch_results";
const char kPrefetchSearchResultsOnSRP[] = "prefetch_results_srp";
const char kAllowPrefetchNonDefaultMatch[] = "allow_prefetch_non_default_match";
const char kPrerenderInstantUrlOnOmniboxFocus[] =
"prerender_instant_url_on_omnibox_focus";
+#if defined(OS_ANDROID)
+const char kPrefetchSearchResultsFlagName[] = "prefetch_results";
+
// Controls whether to reuse prerendered Instant Search base page to commit any
// search query.
const char kReuseInstantSearchBasePage[] = "reuse_instant_search_base_page";
+#endif
// Controls whether to use the alternate Instant search base URL. This allows
// experimentation of Instant search.
@@ -596,6 +599,7 @@ bool ShouldPrefetchSearchResults() {
if (!IsInstantExtendedAPIEnabled())
return false;
+#if defined(OS_ANDROID)
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kPrefetchSearchResults)) {
return true;
@@ -604,6 +608,9 @@ bool ShouldPrefetchSearchResults() {
FieldTrialFlags flags;
return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault(
kPrefetchSearchResultsFlagName, false, flags);
+#else
+ return true;
+#endif
}
bool ShouldAllowPrefetchNonDefaultMatch() {
@@ -628,9 +635,13 @@ bool ShouldReuseInstantSearchBasePage() {
if (!ShouldPrefetchSearchResults())
return false;
+#if defined(OS_ANDROID)
FieldTrialFlags flags;
return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault(
kReuseInstantSearchBasePage, false, flags);
+#else
+ return true;
+#endif
}
GURL GetLocalInstantURL(Profile* profile) {
« no previous file with comments | « chrome/browser/search/instant_service_unittest.cc ('k') | chrome/browser/search/search_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698