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

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

Issue 2134133002: Introduce search::IsInstantNTPURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/search.h
diff --git a/chrome/browser/search/search.h b/chrome/browser/search/search.h
index 99d9ac9ef621e6f03bedbf6461b76237a8103160..2b33dbb26b583f0130686cff380146b68bc495de 100644
--- a/chrome/browser/search/search.h
+++ b/chrome/browser/search/search.h
@@ -88,13 +88,16 @@ bool IsRenderedInInstantProcess(const content::WebContents* contents,
bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile);
// Returns true if |url| corresponds to a New Tab page (it can be either an
-// Instant Extended NTP or a non-extended NTP).
+// Instant Extended NTP or a non-extended NTP). A page that matches the search
+// or Instant URL of the default search provider but does not have any search
+// terms is considered an Instant NTP.
+// TODO(treib): This is confusingly named, as it includes URLs that are related
+// to an NTP, but aren't an NTP themselves (such as the Instant URL, e.g.
+// https://www.google.com/webhp?espv=2).
bool IsNTPURL(const GURL& url, Profile* profile);
// Returns true if the visible entry of |contents| is a New Tab Page rendered
-// by Instant. A page that matches the search or Instant URL of the default
-// search provider but does not have any search terms is considered an Instant
-// New Tab Page.
+// by Instant.
bool IsInstantNTP(const content::WebContents* contents);
// Same as IsInstantNTP but uses |nav_entry| to determine the URL for the page
@@ -102,6 +105,10 @@ bool IsInstantNTP(const content::WebContents* contents);
bool NavEntryIsInstantNTP(const content::WebContents* contents,
const content::NavigationEntry* nav_entry);
+// Returns true if |url| corresponds to a New Tab page that would get rendered
+// by Instant.
+bool IsInstantNTPURL(const GURL& url, Profile* profile);
+
// Returns the Instant URL of the default search engine. Returns an empty GURL
// if the engine doesn't have an Instant URL, or if it shouldn't be used (say
// because it doesn't satisfy the requirements for extended mode or if Instant
« no previous file with comments | « no previous file | chrome/browser/search/search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698