| Index: components/search_engines/template_url.h
|
| diff --git a/components/search_engines/template_url.h b/components/search_engines/template_url.h
|
| index 2acb146851887d0f8246dbf56c4b60071374d097..704ede05ce4aff6659890181f1e46485316cf177 100644
|
| --- a/components/search_engines/template_url.h
|
| +++ b/components/search_engines/template_url.h
|
| @@ -255,24 +255,35 @@ class TemplateURLRef {
|
| const std::string& GetHost(const SearchTermsData& search_terms_data) const;
|
| const std::string& GetPath(const SearchTermsData& search_terms_data) const;
|
|
|
| + // If this TemplateURLRef is valid and contains one search term, this returns
|
| + // whether its path ends with text "{google:ignorePathEnding}", otherwise this
|
| + // returns false.
|
| + bool GetIgnorePathEnding(const SearchTermsData& search_terms_data) const;
|
| +
|
| // If this TemplateURLRef is valid and contains one search term
|
| // in its query or ref, this returns the key of the search term,
|
| // otherwise this returns an empty string.
|
| const std::string& GetSearchTermKey(
|
| const SearchTermsData& search_terms_data) const;
|
|
|
| - // If this TemplateURLRef is valid and contains one search term
|
| - // in its path, this returns the length of the subpath before the search term,
|
| - // otherwise this returns std::string::npos.
|
| - size_t GetSearchTermPositionInPath(
|
| - const SearchTermsData& search_terms_data) const;
|
| -
|
| // If this TemplateURLRef is valid and contains one search term,
|
| // this returns the location of the search term,
|
| // otherwise this returns url::Parsed::QUERY.
|
| url::Parsed::ComponentType GetSearchTermKeyLocation(
|
| const SearchTermsData& search_terms_data) const;
|
|
|
| + // If this TemplateURLRef is valid and contains one search term,
|
| + // this returns the fixed prefix of the value of the search term,
|
| + // otherwise this returns an empty string.
|
| + const std::string& GetSearchTermValuePrefix(
|
| + const SearchTermsData& search_terms_data) const;
|
| +
|
| + // If this TemplateURLRef is valid and contains one search term,
|
| + // this returns the fixed suffix of the value of the search term,
|
| + // otherwise this returns an empty string.
|
| + const std::string& GetSearchTermValueSuffix(
|
| + const SearchTermsData& search_terms_data) const;
|
| +
|
| // Converts the specified term in our owner's encoding to a base::string16.
|
| base::string16 SearchTermToString16(const std::string& term) const;
|
|
|
| @@ -369,6 +380,16 @@ class TemplateURLRef {
|
| typedef std::vector<struct Replacement> Replacements;
|
| typedef std::vector<PostParam> PostParams;
|
|
|
| + // Checks that |path| matches to this TemplateURLRef's path.
|
| + // This is a helper function for extracting search terms from URL.
|
| + bool MatchPath(const std::string& path) const;
|
| +
|
| + // Checks that |path| matches to this TemplateURLRef's path and
|
| + // extracts the position of the search terms inside |path|.
|
| + // This is a helper function for extracting search terms from URL.
|
| + bool MatchPathWithSearchTerms(const std::string& path,
|
| + url::Component* search_terms_position) const;
|
| +
|
| // TemplateURLRef internally caches values to make replacement quick. This
|
| // method invalidates any cached values.
|
| void InvalidateCachedValues() const;
|
| @@ -464,8 +485,8 @@ class TemplateURLRef {
|
| mutable std::string host_;
|
| mutable std::string port_;
|
| mutable std::string path_;
|
| + mutable bool ignore_path_ending_;
|
| mutable std::string search_term_key_;
|
| - mutable size_t search_term_position_in_path_;
|
| mutable url::Parsed::ComponentType search_term_key_location_;
|
| mutable std::string search_term_value_prefix_;
|
| mutable std::string search_term_value_suffix_;
|
|
|