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

Unified Diff: components/search_engines/template_url.h

Issue 2877983002: Use search_term_value_prefix_ & search_term_value_suffix_ to specify the location of {searchTerms} … (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | components/search_engines/template_url.cc » ('j') | components/search_engines/template_url.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url.h
diff --git a/components/search_engines/template_url.h b/components/search_engines/template_url.h
index a3c83cee07583749aaad3facae53fc3edfd5f6e5..eeee4f65fed21b822336469677805a875690754d 100644
--- a/components/search_engines/template_url.h
+++ b/components/search_engines/template_url.h
@@ -238,20 +238,26 @@ class TemplateURLRef {
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 before 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 after 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;
+ base::string16 SearchTermToString16(const base::StringPiece& term) const;
// Returns true if this TemplateURLRef has a replacement term of
// {google:baseURL} or {google:baseSuggestURL}.
@@ -442,7 +448,6 @@ class TemplateURLRef {
mutable std::string port_;
mutable std::string path_;
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_;
« no previous file with comments | « no previous file | components/search_engines/template_url.cc » ('j') | components/search_engines/template_url.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698