Index: chrome/browser/page_load_metrics/page_load_metrics_util.h |
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.h b/chrome/browser/page_load_metrics/page_load_metrics_util.h |
index a0af192a8b21db5b51127f0313538d4dab7576b6..fc56e84abf23fd8e15f932ee9e8d295ccdd18fd1 100644 |
--- a/chrome/browser/page_load_metrics/page_load_metrics_util.h |
+++ b/chrome/browser/page_load_metrics/page_load_metrics_util.h |
@@ -131,6 +131,21 @@ bool DidObserveLoadingBehaviorInAnyFrame( |
const page_load_metrics::PageLoadExtraInfo& info, |
blink::WebLoadingBehaviorFlag behavior); |
+// Whether the given url has a google hostname. |
+bool IsGoogleHostname(const GURL& url); |
+ |
+// Returns whether the given url has google hostname. If true, emits the portion |
+// of the hostname before the google hostname in |out_google_hostname_prefix|. |
+// |
+// For example: |
+// https://google.com/foo => true, out_google_hostname_prefix = '' |
+// https://www.google.com/foo => true, out_google_hostname_prefix = 'www' |
+// https://news.google.com/foo => true, out_google_hostname_prefix = 'news' |
+// https://a.b.c.google.com/foo => true, out_google_hostname_prefix = 'a.b.c' |
+bool IsGoogleHostnameAndGetPrefix( |
+ const GURL& url, |
+ base::StringPiece* out_google_hostname_prefix); |
+ |
} // namespace page_load_metrics |
#endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_ |