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

Unified Diff: chrome/browser/search/search.cc

Issue 135383002: InstantExtended: assign all cacheable NTPs to the same process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests. Created 6 years, 10 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 | « no previous file | chrome/browser/search/search_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index 5d8a7dfa0ac92decf4cc8cc6b717b88027a0c4dd..983ef42a4519a774ab1e723aca1146ec5805f60c 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -448,7 +448,7 @@ bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) {
bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) {
return ShouldAssignURLToInstantRenderer(url, profile) &&
(url.host() == chrome::kChromeSearchLocalNtpHost ||
- url.host() == chrome::kChromeSearchOnlineNtpHost);
+ url.host() == chrome::kChromeSearchRemoteNtpHost);
}
bool IsNTPURL(const GURL& url, Profile* profile) {
@@ -679,18 +679,14 @@ GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile) {
replacements.SetScheme(search_scheme.data(),
url_parse::Component(0, search_scheme.length()));
- // If the URL corresponds to an online NTP, replace the host with
- // "online-ntp".
- std::string online_ntp_host(chrome::kChromeSearchOnlineNtpHost);
- TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
- if (template_url) {
- const GURL instant_url = TemplateURLRefToGURL(
- template_url->instant_url_ref(), kDisableStartMargin, false, false);
- if (instant_url.is_valid() &&
- search::MatchesOriginAndPath(url, instant_url)) {
- replacements.SetHost(online_ntp_host.c_str(),
- url_parse::Component(0, online_ntp_host.length()));
- }
+ // If this is the URL for a server-provided NTP, replace the host with
+ // "remote-ntp".
+ std::string remote_ntp_host(chrome::kChromeSearchRemoteNtpHost);
+ NewTabURLDetails details = NewTabURLDetails::ForProfile(profile);
+ if (details.state == NEW_TAB_URL_VALID &&
+ search::MatchesOriginAndPath(url, details.url)) {
+ replacements.SetHost(remote_ntp_host.c_str(),
+ url_parse::Component(0, remote_ntp_host.length()));
}
effective_url = effective_url.ReplaceComponents(replacements);
« no previous file with comments | « no previous file | chrome/browser/search/search_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698