Index: chrome/browser/prerender/prerender_util.cc |
=================================================================== |
--- chrome/browser/prerender/prerender_util.cc (revision 98877) |
+++ chrome/browser/prerender/prerender_util.cc (working copy) |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/prerender/prerender_util.h" |
#include "base/logging.h" |
+#include "base/string_util.h" |
#include "googleurl/src/url_canon.h" |
#include "googleurl/src/url_parse.h" |
#include "googleurl/src/url_util.h" |
@@ -61,4 +62,13 @@ |
return kNoExperiment; |
} |
+bool IsGoogleSearchResultURL(const GURL& url) { |
+ if (!StartsWithASCII(url.host(), std::string("www.google."), true)) |
+ return false; |
+ return (url.path().empty() || |
+ StartsWithASCII(url.path(), std::string("/search"), true) || |
+ (url.path() == "/") || |
+ StartsWithASCII(url.path(), std::string("/webhp"), true)); |
+} |
+ |
} // namespace prerender |