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

Unified Diff: chrome/browser/prerender/prerender_util.cc

Issue 7812011: Tighten conditions for when a URL is a search result, and move (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « chrome/browser/prerender/prerender_util.h ('k') | chrome/browser/prerender/prerender_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/prerender/prerender_util.h ('k') | chrome/browser/prerender/prerender_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698