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

Unified Diff: components/search_engines/template_url_parser.cc

Issue 1135163002: Omnibox - Strip Extra Whitespace from Custom Search Engine Names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: components/search_engines/template_url_parser.cc
diff --git a/components/search_engines/template_url_parser.cc b/components/search_engines/template_url_parser.cc
index 14298da11b6b5381db9598403584cf259bf2b487..edcc1dcbed3100609b0697fea84bd51df3916190 100644
--- a/components/search_engines/template_url_parser.cc
+++ b/components/search_engines/template_url_parser.cc
@@ -251,7 +251,7 @@ void TemplateURLParsingContext::EndElementImpl(void* ctx, const xmlChar* name) {
context->ProcessURLParams();
break;
case TemplateURLParsingContext::SHORT_NAME:
- context->data_.short_name = context->string_;
+ context->data_.SetShortName(context->string_);
break;
case TemplateURLParsingContext::IMAGE: {
GURL image_url(base::UTF16ToUTF8(context->string_));
@@ -299,8 +299,9 @@ TemplateURL* TemplateURLParsingContext::GetTemplateURL(
const SearchTermsData& search_terms_data,
bool show_in_default_list) {
// TODO(jcampan): Support engines that use POST; see http://crbug.com/18107
- if (method_ == TemplateURLParsingContext::POST || data_.short_name.empty() ||
- !IsHTTPRef(data_.url()) || !IsHTTPRef(data_.suggestions_url))
+ if (method_ == TemplateURLParsingContext::POST ||
+ data_.short_name().empty() || !IsHTTPRef(data_.url()) ||
+ !IsHTTPRef(data_.suggestions_url))
return NULL;
if (suggestion_method_ == TemplateURLParsingContext::POST)
data_.suggestions_url.clear();

Powered by Google App Engine
This is Rietveld 408576698