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

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

Issue 338363004: Remove Profile* from TemplateURL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 6 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
« no previous file with comments | « chrome/browser/search_engines/template_url.h ('k') | chrome/browser/search_engines/template_url_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url.cc
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index 6cc39b781d2d08d889314e384a2239199b843cf4..903451375fda030095e8dc227efb29c55f0b22c9 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -1128,9 +1128,8 @@ std::string TemplateURLRef::HandleReplacements(
// TemplateURL ----------------------------------------------------------------
-TemplateURL::TemplateURL(Profile* profile, const TemplateURLData& data)
- : profile_(profile),
- data_(data),
+TemplateURL::TemplateURL(const TemplateURLData& data)
+ : data_(data),
url_ref_(this, TemplateURLRef::SEARCH),
suggestions_url_ref_(this,
TemplateURLRef::SUGGEST),
@@ -1233,7 +1232,7 @@ bool TemplateURL::HasSameKeywordAs(
const SearchTermsData& search_terms_data) const {
return (data_.keyword() == other.keyword()) ||
(IsGoogleSearchURLWithReplaceableKeyword(search_terms_data) &&
- TemplateURL(NULL, other).IsGoogleSearchURLWithReplaceableKeyword(
+ TemplateURL(other).IsGoogleSearchURLWithReplaceableKeyword(
search_terms_data));
}
@@ -1359,7 +1358,6 @@ void TemplateURL::CopyFrom(const TemplateURL& other) {
if (this == &other)
return;
- profile_ = other.profile_;
data_ = other.data_;
url_ref_.InvalidateCachedValues();
suggestions_url_ref_.InvalidateCachedValues();
@@ -1385,7 +1383,7 @@ void TemplateURL::ResetKeywordIfNecessary(
bool force) {
if (IsGoogleSearchURLWithReplaceableKeyword(search_terms_data) || force) {
DCHECK(GetType() != OMNIBOX_API_EXTENSION);
- GURL url(TemplateURLService::GenerateSearchURL(this));
+ GURL url(TemplateURLService::GenerateSearchURL(this, search_terms_data));
if (url.is_valid())
data_.SetKeyword(TemplateURLService::GenerateKeyword(url));
}
« no previous file with comments | « chrome/browser/search_engines/template_url.h ('k') | chrome/browser/search_engines/template_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698