Chromium Code Reviews| Index: chrome/browser/prerender/prerender_util.cc |
| =================================================================== |
| --- chrome/browser/prerender/prerender_util.cc (revision 98872) |
| +++ 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() || |
|
dominich
2011/08/30 23:43:33
nit: can the URL path be empty? I thought it was a
|
| + StartsWithASCII(url.path(), std::string("/search"), true) || |
| + (url.path() == "/") || |
| + StartsWithASCII(url.path(), std::string("/webhp"), true)); |
| +} |
| + |
| } // namespace prerender |