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

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

Issue 2898313003: Ensure the NTP ServiceWorker has the proper site URL (Closed)
Patch Set: Rebase + addressed comments Created 3 years, 7 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 e0bd3d894d41229a04d517e2e9f0c6cb6f28ea21..31d91601fccc029488557b7d7654d5c361a9080f 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -135,8 +135,10 @@ bool IsInstantURL(const GURL& url, Profile* profile) {
return false;
const GURL new_tab_url(GetNewTabPageURL(profile));
- if (new_tab_url.is_valid() && MatchesOriginAndPath(url, new_tab_url))
+ if (new_tab_url.is_valid() && (MatchesOriginAndPath(url, new_tab_url) ||
+ IsMatchingServiceWorker(url, new_tab_url))) {
return true;
+ }
const TemplateURL* template_url =
GetDefaultSearchProviderTemplateURL(profile);
@@ -420,7 +422,8 @@ GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile) {
std::string remote_ntp_host(chrome::kChromeSearchRemoteNtpHost);
NewTabURLDetails details = NewTabURLDetails::ForProfile(profile);
if (details.state == NEW_TAB_URL_VALID &&
- MatchesOriginAndPath(url, details.url)) {
+ (MatchesOriginAndPath(url, details.url) ||
+ IsMatchingServiceWorker(url, details.url))) {
replacements.SetHost(remote_ntp_host.c_str(),
url::Component(0, remote_ntp_host.length()));
}
« 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