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

Unified Diff: chrome/browser/search_engines/template_url_fetcher.cc

Issue 9982018: Move most TemplateURL data members to a new struct, TemplateURLData. This allows us to eliminate t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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: chrome/browser/search_engines/template_url_fetcher.cc
===================================================================
--- chrome/browser/search_engines/template_url_fetcher.cc (revision 130759)
+++ chrome/browser/search_engines/template_url_fetcher.cc (working copy)
@@ -147,8 +147,8 @@
return;
}
- template_url_.reset(TemplateURLParser::Parse(fetcher_->profile(), data.data(),
- data.length(), NULL));
+ template_url_.reset(TemplateURLParser::Parse(fetcher_->profile(), false,
+ data.data(), data.length(), NULL));
if (!template_url_.get() || !template_url_->url_ref().SupportsReplacement()) {
fetcher_->RequestCompleted(this);
// WARNING: RequestCompleted deletes us.
@@ -194,18 +194,19 @@
// The short name is what is shown to the user. We preserve original names
// since it is better when generated keyword in many cases.
- template_url_->set_keyword(keyword_);
- template_url_->set_originating_url(osdd_url_);
+ TemplateURLData data(template_url_->data());
+ data.SetKeyword(keyword_);
+ data.originating_url = osdd_url_;
// The page may have specified a URL to use for favicons, if not, set it.
- if (!template_url_->favicon_url().is_valid())
- template_url_->set_favicon_url(favicon_url_);
+ if (!data.favicon_url.is_valid())
+ data.favicon_url = favicon_url_;
switch (provider_type_) {
case AUTODETECTED_PROVIDER:
// Mark the keyword as replaceable so it can be removed if necessary.
- template_url_->set_safe_for_autoreplace(true);
- model->Add(template_url_.release());
+ data.safe_for_autoreplace = true;
+ model->Add(new TemplateURL(data));
break;
case EXPLICIT_PROVIDER:
@@ -215,7 +216,7 @@
// The source TabContents' delegate takes care of adding the URL to the
// model, which takes ownership, or of deleting it if the add is
// cancelled.
- callbacks_->ConfirmAddSearchProvider(template_url_.release(),
+ callbacks_->ConfirmAddSearchProvider(new TemplateURL(data),
fetcher_->profile());
break;
« no previous file with comments | « chrome/browser/search_engines/template_url.cc ('k') | chrome/browser/search_engines/template_url_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698