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

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: '' 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
Index: chrome/browser/search/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index d473454fd0b7e1adbbf0fc12e4d97ddd9d19634c..a3179d4cc03a5454b4fa2c7947e29659f5874b7f 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,8 @@ bool ShouldPrefetchSearchResults() {
FieldTrialFlags flags;
return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault(
kPrefetchSearchResultsFlagName, false, flags);
+#endif
+ return true;
Jered 2014/07/14 16:18:27 nit: It would be slightly clearer to write #else .
kmadhusu 2014/07/14 19:37:15 Done.
}
bool ShouldAllowPrefetchNonDefaultMatch() {
@@ -628,9 +634,12 @@ bool ShouldReuseInstantSearchBasePage() {
if (!ShouldPrefetchSearchResults())
return false;
+#if defined(OS_ANDROID)
FieldTrialFlags flags;
return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault(
kReuseInstantSearchBasePage, false, flags);
+#endif
+ return true;
}
GURL GetLocalInstantURL(Profile* profile) {

Powered by Google App Engine
This is Rietveld 408576698