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

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

Issue 141893009: Create a new helper function to extract search terms from the URL irrespective of the availablility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 years, 10 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.h
diff --git a/chrome/browser/search/search.h b/chrome/browser/search/search.h
index 68ac6d864f792ee1b34f247e58344b83de1ca373..c16bb6921c4c077c164c00a56992f47a835c5f62 100644
--- a/chrome/browser/search/search.h
+++ b/chrome/browser/search/search.h
@@ -78,15 +78,23 @@ bool IsSuggestPrefEnabled(Profile* profile);
// the Instant Extended API is not enabled.
uint64 EmbeddedSearchPageVersion();
-// Returns whether query extraction is enabled.
+// Returns whether query extraction flag is enabled in the field trials.
bool IsQueryExtractionEnabled();
-// Extracts and returns search terms from |url|. Returns empty string if the URL
-// is not secure or doesn't have a search term replacement key. Does not
-// consider IsQueryExtractionEnabled() and Instant support state of the page and
-// does not check for a privileged process, so most callers should use
+// Extracts and returns search terms from |url|. Does not consider
+// IsQueryExtractionEnabled() and Instant support state of the page and does
+// not check for a privileged process, so most callers should use
// GetSearchTerms() below instead.
-base::string16 GetSearchTermsFromURL(Profile* profile, const GURL& url);
+base::string16 ExtractSearchTermsFromURL(Profile* profile, const GURL& url);
+
+// Returns true if |url| passes some basic checks that must succeed for it to be
+// usable as an instant URL:
Jered 2014/02/11 19:10:10 How about rewording this comment: "Returns true if
kmadhusu 2014/02/11 23:24:32 Done.
+// (1) It contains the search terms replacement key of |template_url|, which is
+// expected to be the TemplateURL* for the default search provider.
+// (2) Either it has a secure scheme, or else the user has manually specified a
+// --google-base-url and it uses that base URL. (This allows testers to use
+// --google-base-url to point at non-HTTPS servers, which eases testing.)
+bool IsSuitableURLForInstant(Profile* profile, const GURL& url);
kmadhusu 2014/02/11 01:40:03 This function deserves a better name. I would like
Jered 2014/02/11 19:10:10 How about IsQueryExtractionAllowedForURL()?
kmadhusu 2014/02/11 23:24:32 Done.
// Returns the search terms attached to a specific NavigationEntry, or empty
// string otherwise. Does not consider IsQueryExtractionEnabled() and does not

Powered by Google App Engine
This is Rietveld 408576698