Index: chrome/browser/search/search.cc |
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc |
index 479d095524a926ed10138f895be3decaf15cdd40..79bc9b6ff9f7bb0226b5b69b1a23c62d7b2c380e 100644 |
--- a/chrome/browser/search/search.cc |
+++ b/chrome/browser/search/search.cc |
@@ -120,6 +120,15 @@ GURL TemplateURLRefToGURL(const TemplateURLRef& ref, |
return GURL(ref.ReplaceSearchTerms(search_terms_args, search_terms_data)); |
} |
+// |url| should either have a secure scheme or have a non-HTTPS base URL that |
+// the user specified using --google-base-url. (This allows testers to use |
+// --google-base-url to point at non-HTTPS servers, which eases testing.) |
+bool IsSuitableURLForInstant(const GURL& url, const TemplateURL* template_url) { |
+ return template_url->HasSearchTermsReplacementKey(url) && |
+ (url.SchemeIsCryptographic() || |
+ google_util::StartsWithCommandLineGoogleBaseURL(url)); |
+} |
+ |
// Returns true if |url| can be used as an Instant URL for |profile|. |
bool IsInstantURL(const GURL& url, Profile* profile) { |
if (!IsInstantExtendedAPIEnabled()) |
@@ -261,11 +270,6 @@ base::string16 ExtractSearchTermsFromURL(Profile* profile, const GURL& url) { |
return search_terms; |
} |
-bool IsQueryExtractionAllowedForURL(Profile* profile, const GURL& url) { |
- TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile); |
- return template_url && IsSuitableURLForInstant(url, template_url); |
-} |
- |
bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) { |
return url.is_valid() && |
profile && |
@@ -392,7 +396,7 @@ GURL GetNewTabPageURL(Profile* profile) { |
} |
GURL GetSearchResultPrefetchBaseURL(Profile* profile) { |
- return ShouldPrefetchSearchResults() ? GetInstantURL(profile, true) : GURL(); |
+ return GetInstantURL(profile, true); |
} |
GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile) { |