summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines/template_url.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-29 20:35:19 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-29 20:35:19 +0000
commitddd231eaa03153f6d04894cceb0b4480755e1277 (patch)
treefaafed02945c1f8934e6e393ac0c6b094c303cdf /chrome/browser/search_engines/template_url.h
parentc5e30d8572ffae1e0d4fbb2fff765f9a8cbace77 (diff)
downloadchromium_src-ddd231eaa03153f6d04894cceb0b4480755e1277.zip
chromium_src-ddd231eaa03153f6d04894cceb0b4480755e1277.tar.gz
chromium_src-ddd231eaa03153f6d04894cceb0b4480755e1277.tar.bz2
Change a bunch of string types.
Started out just trying to change PrefService::GetString and ::SetString. This snowballed a little bit. Had to change a bunch of url strings in search_engines/ from wstring to string (some of them may be better off as GURLs, but UTF-8 is a step in the right direction, since that's what GURL uses internally, as well as externally via its setters/getters). TODO (later patch): things that ask for accepted languages should use std::string, not std::wstring. BUG=none TEST=try bots Review URL: http://codereview.chromium.org/2854015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines/template_url.h')
-rw-r--r--chrome/browser/search_engines/template_url.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h
index 8641720..fb8a707 100644
--- a/chrome/browser/search_engines/template_url.h
+++ b/chrome/browser/search_engines/template_url.h
@@ -45,7 +45,7 @@ class TemplateURLRef {
TemplateURLRef();
- TemplateURLRef(const std::wstring& url, int index_offset, int page_offset)
+ TemplateURLRef(const std::string& url, int index_offset, int page_offset)
: url_(url),
index_offset_(index_offset),
page_offset_(page_offset),
@@ -64,14 +64,14 @@ class TemplateURLRef {
// returns false), an empty string is returned.
//
// The TemplateURL is used to determine the input encoding for the term.
- std::wstring ReplaceSearchTerms(
+ std::string ReplaceSearchTerms(
const TemplateURL& host,
const std::wstring& terms,
int accepted_suggestion,
const std::wstring& original_query_for_suggestion) const;
// Returns the raw URL. None of the parameters will have been replaced.
- const std::wstring& url() const { return url_; }
+ const std::string& url() const { return url_; }
// Returns the index number of the first search result.
int index_offset() const { return index_offset_; }
@@ -89,7 +89,7 @@ class TemplateURLRef {
// Converts a string as returned by DisplayURL back into a string as
// understood by TemplateURLRef.
- static std::wstring DisplayURLToURLRef(const std::wstring& display_url);
+ static std::string DisplayURLToURLRef(const std::wstring& display_url);
// If this TemplateURLRef is valid and contains one search term, this returns
// the host/path of the URL, otherwise this returns an empty string.
@@ -150,7 +150,7 @@ class TemplateURLRef {
void InvalidateCachedValues() const;
// Resets the url.
- void Set(const std::wstring& url, int index_offset, int page_offset);
+ void Set(const std::string& url, int index_offset, int page_offset);
// Parses the parameter in url at the specified offset. start/end specify the
// range of the parameter in the url, including the braces. If the parameter
@@ -163,7 +163,7 @@ class TemplateURLRef {
// returned.
bool ParseParameter(size_t start,
size_t end,
- std::wstring* url,
+ std::string* url,
Replacements* replacements) const;
// Parses the specified url, replacing parameters as necessary. If
@@ -171,9 +171,9 @@ class TemplateURLRef {
// known parameters that are encountered an entry is added to replacements.
// If there is an error parsing the url, valid is set to false, and an empty
// string is returned.
- std::wstring ParseURL(const std::wstring& url,
- Replacements* replacements,
- bool* valid) const;
+ std::string ParseURL(const std::string& url,
+ Replacements* replacements,
+ bool* valid) const;
// If the url has not yet been parsed, ParseURL is invoked.
// NOTE: While this is const, it modifies parsed_, valid_, parsed_url_ and
@@ -184,14 +184,14 @@ class TemplateURLRef {
void ParseHostAndSearchTermKey() const;
// Returns the value for the GOOGLE_BASE_URL term.
- static std::wstring GoogleBaseURLValue();
+ static std::string GoogleBaseURLValue();
// Returns the value for the GOOGLE_BASE_SUGGEST_URL term.
- static std::wstring GoogleBaseSuggestURLValue();
+ static std::string GoogleBaseSuggestURLValue();
// The raw URL. Where as this contains all the terms (such as {searchTerms}),
// parsed_url_ has them all stripped out.
- std::wstring url_;
+ std::string url_;
// indexOffset defined for the Url element.
int index_offset_;
@@ -207,7 +207,7 @@ class TemplateURLRef {
// The parsed URL. All terms have been stripped out of this with
// replacements_ giving the index of the terms to replace.
- mutable std::wstring parsed_url_;
+ mutable std::string parsed_url_;
// Do we support replacement?
mutable bool supports_replacements_;
@@ -224,7 +224,7 @@ class TemplateURLRef {
// For testing. If non-null this is the replacement value for GOOGLE_BASE_URL
// terms.
- static std::wstring* google_base_url_;
+ static std::string* google_base_url_;
};
// Describes the relevant portions of a single OSD document.
@@ -298,7 +298,7 @@ class TemplateURL {
// as your type. If NULL, this url does not support suggestions.
// Be sure and check the resulting TemplateURLRef for SupportsReplacement
// before using.
- void SetSuggestionsURL(const std::wstring& suggestions_url,
+ void SetSuggestionsURL(const std::string& suggestions_url,
int index_offset,
int page_offset);
const TemplateURLRef* suggestions_url() const {
@@ -310,7 +310,7 @@ class TemplateURL {
// Parameterized URL for providing the results. This may be NULL.
// Be sure and check the resulting TemplateURLRef for SupportsReplacement
// before using.
- void SetURL(const std::wstring& url, int index_offset, int page_offset);
+ void SetURL(const std::string& url, int index_offset, int page_offset);
// Returns the TemplateURLRef that may be used for search results. This
// returns NULL if a url element was not specified.
const TemplateURLRef* url() const {