| Index: chrome/browser/search_engines/template_url.h
|
| diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h
|
| index 6d2a9db0329e7f08bd0d1c459b8dbba021db915b..2f3db69afff17cbdf6645e9be50e3b7ffa3adb24 100644
|
| --- a/chrome/browser/search_engines/template_url.h
|
| +++ b/chrome/browser/search_engines/template_url.h
|
| @@ -140,9 +140,13 @@ class TemplateURLRef {
|
| // Use the pattern referred to by this TemplateURLRef to match the provided
|
| // |url| and extract |search_terms| from it. Returns true if the pattern
|
| // matches, even if |search_terms| is empty. Returns false and an empty
|
| - // |search_terms| if the pattern does not match.
|
| + // |search_terms| if the pattern does not match. If |need_instant_extended|
|
| + // is true, then a match will only be returned if the instant extended
|
| + // parameter is found and non-zero, moreover, the instant extended parameter
|
| + // must be found in the same region as the search term (the query or the ref).
|
| bool ExtractSearchTermsFromURL(const GURL& url,
|
| - string16* search_terms) const;
|
| + string16* search_terms,
|
| + bool needs_instant_extended) const;
|
|
|
| private:
|
| friend class TemplateURL;
|
| @@ -477,15 +481,19 @@ class TemplateURL {
|
|
|
| // Use the alternate URLs and the search URL to match the provided |url|
|
| // and extract |search_terms| from it. Returns false and an empty
|
| - // |search_terms| if no search terms can be matched. The order in which the
|
| - // alternate URLs are listed dictates their priority, the URL at index 0
|
| - // is treated as the highest priority and the primary search URL is treated
|
| - // as the lowest priority (see GetURL()). For example, if a TemplateURL has
|
| - // alternate URL "http://foo/#q={searchTerms}" and search URL
|
| - // "http://foo/?q={searchTerms}", and the URL to be decoded is
|
| + // |search_terms| if no search terms can be matched. The method also returns
|
| + // false if |needs_instant_extended| is true and the query or ref parameter
|
| + // corresponding to search_terms_replacement_key() is not found or is 0.
|
| + // The order in which the alternate URLs are listed dictates their priority,
|
| + // the URL at index 0 is treated as the highest priority and the primary
|
| + // search URL is treated as the lowest priority (see GetURL()). For example,
|
| + // if a TemplateURL has alternate URL "http://foo/#q={searchTerms}" and search
|
| + // URL "http://foo/?q={searchTerms}", and the URL to be decoded is
|
| // "http://foo/?q=a#q=b", the alternate URL will match first and the decoded
|
| // search term will be "b".
|
| - bool ExtractSearchTermsFromURL(const GURL& url, string16* search_terms);
|
| + bool ExtractSearchTermsFromURL(const GURL& url,
|
| + string16* search_terms,
|
| + bool needs_instant_extended);
|
|
|
| private:
|
| friend class TemplateURLService;
|
|
|