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

Unified Diff: chrome/browser/instant/instant_loader.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/instant/instant_loader.cc
===================================================================
--- chrome/browser/instant/instant_loader.cc (revision 132905)
+++ chrome/browser/instant/instant_loader.cc (working copy)
@@ -727,8 +727,7 @@
complete_suggested_text_.substr(user_text_.size());
}
} else {
- LoadInstantURL(tab_contents, template_url, transition_type, user_text_,
- verbatim);
+ LoadInstantURL(template_url, transition_type, user_text_, verbatim);
}
} else {
DCHECK(template_url_id_ == 0);
@@ -856,8 +855,8 @@
return;
CreatePreviewContents(tab_contents);
- LoadInstantURL(tab_contents, template_url, content::PAGE_TRANSITION_GENERATED,
- string16(), true);
+ LoadInstantURL(template_url, content::PAGE_TRANSITION_GENERATED, string16(),
+ true);
}
bool InstantLoader::IsNavigationPending() const {
@@ -1112,8 +1111,7 @@
preview_contents_->web_contents()->ShowContents();
}
-void InstantLoader::LoadInstantURL(TabContentsWrapper* tab_contents,
- const TemplateURL* template_url,
+void InstantLoader::LoadInstantURL(const TemplateURL* template_url,
content::PageTransition transition_type,
const string16& user_text,
bool verbatim) {
@@ -1127,10 +1125,8 @@
// functionality so that embeded tags (like {google:baseURL}) are escaped
// correctly.
// TODO(sky): having to use a replaceable url is a bit of a hack here.
- GURL instant_url(
- template_url->instant_url_ref().ReplaceSearchTermsUsingProfile(
- tab_contents->profile(), string16(),
- TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()));
+ GURL instant_url(template_url->instant_url_ref().ReplaceSearchTerms(
+ string16(), TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()));
CommandLine* cl = CommandLine::ForCurrentProcess();
if (cl->HasSwitch(switches::kInstantURL))
instant_url = GURL(cl->GetSwitchValueASCII(switches::kInstantURL));

Powered by Google App Engine
This is Rietveld 408576698