| Index: chrome/browser/search_engines/template_url_parser.cc
|
| diff --git a/chrome/browser/search_engines/template_url_parser.cc b/chrome/browser/search_engines/template_url_parser.cc
|
| index 8304a79b80148a47d71cc733fc314889b641ce2a..c338ceb752429d888b2338e5f633ddcada8a7f4d 100644
|
| --- a/chrome/browser/search_engines/template_url_parser.cc
|
| +++ b/chrome/browser/search_engines/template_url_parser.cc
|
| @@ -13,7 +13,6 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| -#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
|
| #include "components/search_engines/template_url.h"
|
| #include "libxml/parser.h"
|
| #include "libxml/xmlwriter.h"
|
| @@ -139,7 +138,8 @@ class TemplateURLParsingContext {
|
| // This will be NULL if parsing failed or if the results were invalid for some
|
| // reason (e.g. the resulting URL was not HTTP[S], a name wasn't supplied,
|
| // a resulting TemplateURLRef was invalid, etc.).
|
| - TemplateURL* GetTemplateURL(Profile* profile, bool show_in_default_list);
|
| + TemplateURL* GetTemplateURL(const SearchTermsData& search_terms_data,
|
| + bool show_in_default_list);
|
|
|
| private:
|
| // Key is UTF8 encoded.
|
| @@ -283,7 +283,7 @@ void TemplateURLParsingContext::CharactersImpl(void* ctx,
|
| }
|
|
|
| TemplateURL* TemplateURLParsingContext::GetTemplateURL(
|
| - Profile* profile,
|
| + 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() ||
|
| @@ -303,12 +303,10 @@ TemplateURL* TemplateURLParsingContext::GetTemplateURL(
|
|
|
| // Bail if the search URL is empty or if either TemplateURLRef is invalid.
|
| scoped_ptr<TemplateURL> template_url(new TemplateURL(data_));
|
| - scoped_ptr<SearchTermsData> search_terms_data(profile ?
|
| - new UIThreadSearchTermsData(profile) : new SearchTermsData());
|
| if (template_url->url().empty() ||
|
| - !template_url->url_ref().IsValid(*search_terms_data) ||
|
| + !template_url->url_ref().IsValid(search_terms_data) ||
|
| (!template_url->suggestions_url().empty() &&
|
| - !template_url->suggestions_url_ref().IsValid(*search_terms_data))) {
|
| + !template_url->suggestions_url_ref().IsValid(search_terms_data))) {
|
| return NULL;
|
| }
|
|
|
| @@ -470,7 +468,7 @@ TemplateURLParsingContext::ElementType
|
|
|
| // static
|
| TemplateURL* TemplateURLParser::Parse(
|
| - Profile* profile,
|
| + const SearchTermsData& search_terms_data,
|
| bool show_in_default_list,
|
| const char* data,
|
| size_t length,
|
| @@ -490,5 +488,6 @@ TemplateURL* TemplateURLParser::Parse(
|
| static_cast<int>(length));
|
| xmlSubstituteEntitiesDefault(last_sub_entities_value);
|
|
|
| - return error ? NULL : context.GetTemplateURL(profile, show_in_default_list);
|
| + return error ?
|
| + NULL : context.GetTemplateURL(search_terms_data, show_in_default_list);
|
| }
|
|
|