Index: chrome/browser/search/search.cc |
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc |
index 3df6a76540ea0ffc1b450d8b3147feda6be8318b..60f2cd302638dab7dda994a04c54b898da13cc41 100644 |
--- a/chrome/browser/search/search.cc |
+++ b/chrome/browser/search/search.cc |
@@ -411,12 +411,18 @@ bool NavEntryIsInstantNTP(const content::WebContents* contents, |
if (!IsRenderedInInstantProcess(contents, profile)) |
return false; |
- if (entry->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl)) |
+ return IsInstantNTPURL(entry->GetURL(), profile); |
+} |
+ |
+bool IsInstantNTPURL(const GURL& url, Profile* profile) { |
+ if (!IsInstantExtendedAPIEnabled()) |
+ return false; |
+ |
+ if (url == GURL(chrome::kChromeSearchLocalNtpUrl)) |
return true; |
GURL new_tab_url(GetNewTabPageURL(profile)); |
- return new_tab_url.is_valid() && |
- MatchesOriginAndPath(entry->GetURL(), new_tab_url); |
+ return new_tab_url.is_valid() && MatchesOriginAndPath(url, new_tab_url); |
} |
bool IsSuggestPrefEnabled(Profile* profile) { |
@@ -563,13 +569,7 @@ bool HandleNewTabURLReverseRewrite(GURL* url, |
if (profile && profile->IsOffTheRecord()) |
return false; |
- if (MatchesOriginAndPath(GURL(chrome::kChromeSearchLocalNtpUrl), *url)) { |
- *url = GURL(chrome::kChromeUINewTabURL); |
- return true; |
- } |
- |
- GURL new_tab_url(GetNewTabPageURL(profile)); |
- if (new_tab_url.is_valid() && MatchesOriginAndPath(new_tab_url, *url)) { |
+ if (IsInstantNTPURL(*url, profile)) { |
*url = GURL(chrome::kChromeUINewTabURL); |
return true; |
} |