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

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

Issue 10173001: Add a Profile* member to TemplateURL. This makes some invocations of ReplaceSearchTerms() a bit le… (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 132905)
+++ chrome/browser/search_engines/template_url_fetcher.cc (working copy)
@@ -177,8 +177,8 @@
void TemplateURLFetcher::RequestDelegate::AddSearchProvider() {
DCHECK(template_url_.get());
DCHECK(!keyword_.empty());
- TemplateURLService* model = TemplateURLServiceFactory::GetForProfile(
- fetcher_->profile());
+ Profile* profile = fetcher_->profile();
+ TemplateURLService* model = TemplateURLServiceFactory::GetForProfile(profile);
DCHECK(model);
DCHECK(model->loaded());
@@ -206,7 +206,7 @@
case AUTODETECTED_PROVIDER:
// Mark the keyword as replaceable so it can be removed if necessary.
data.safe_for_autoreplace = true;
- model->Add(new TemplateURL(data));
+ model->Add(new TemplateURL(profile, data));
break;
case EXPLICIT_PROVIDER:
@@ -216,8 +216,8 @@
// The source WebContents' delegate takes care of adding the URL to the
// model, which takes ownership, or of deleting it if the add is
// cancelled.
- callbacks_->ConfirmAddSearchProvider(new TemplateURL(data),
- fetcher_->profile());
+ callbacks_->ConfirmAddSearchProvider(new TemplateURL(profile, data),
+ profile);
break;
default:

Powered by Google App Engine
This is Rietveld 408576698