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

Unified Diff: chrome/browser/template_url_model.cc

Issue 14419: Porting in browser/webdata and template_url. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 12 years 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 | « chrome/browser/template_url.cc ('k') | chrome/browser/template_url_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/template_url_model.cc
===================================================================
--- chrome/browser/template_url_model.cc (revision 6978)
+++ chrome/browser/template_url_model.cc (working copy)
@@ -32,7 +32,7 @@
static const wchar_t kSearchTermParameter[] = L"{searchTerms}";
// String in Initializer that is replaced with kSearchTermParameter.
-static const wchar_t kTemplateParameter[](L"%s");
+static const wchar_t kTemplateParameter[] = L"%s";
// Term used when generating a search url. Use something obscure so that on
// the rare case the term replaces the URL it's unlikely another keyword would
@@ -173,7 +173,7 @@
// Remove the scheme.
std::wstring result(l10n_util::ToLower(keyword));
url_parse::Component scheme_component;
- if (url_parse::ExtractScheme(keyword.c_str(),
+ if (url_parse::ExtractScheme(WideToUTF8(keyword).c_str(),
static_cast<int>(keyword.length()),
&scheme_component)) {
// Include trailing ':'.
@@ -200,10 +200,12 @@
return GURL();
if (!search_ref->SupportsReplacement())
- return GURL(search_ref->url());
+ return GURL(WideToUTF8(search_ref->url()));
- return GURL(search_ref->ReplaceSearchTerms(*t_url, kReplacementTerm,
- TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring()));
+ return search_ref->ReplaceSearchTerms(
+ *t_url,
+ kReplacementTerm,
+ TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring());
}
bool TemplateURLModel::CanReplaceKeyword(
@@ -227,7 +229,7 @@
// be replaced. We do this to ensure that if the user assigns a different
// keyword to a generated TemplateURL, we won't regenerate another keyword for
// the same host.
- GURL gurl(url);
+ GURL gurl(WideToUTF8(url));
if (gurl.is_valid() && !gurl.host().empty())
return CanReplaceKeywordForHost(gurl.host(), template_url_to_replace);
return true;
« no previous file with comments | « chrome/browser/template_url.cc ('k') | chrome/browser/template_url_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698