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

Unified Diff: chrome/common/search_urls.cc

Issue 23455047: InstantExtended: Send search URLs to renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missing files. Created 7 years, 3 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
Index: chrome/common/search_urls.cc
diff --git a/chrome/common/search_urls.cc b/chrome/common/search_urls.cc
new file mode 100644
index 0000000000000000000000000000000000000000..80489cc58f8d2ac13638b9176a8d1a6fea73fa2c
--- /dev/null
+++ b/chrome/common/search_urls.cc
@@ -0,0 +1,20 @@
+#include "chrome/common/search_urls.h"
+
+#include "content/public/common/url_constants.h"
+#include "url/gurl.h"
+
+namespace search {
+namespace {
+bool MatchesOrigin(const GURL& my_url, const GURL& other_url) {
+ return my_url.host() == other_url.host() &&
+ my_url.port() == other_url.port() &&
+ (my_url.scheme() == other_url.scheme() ||
+ (my_url.SchemeIs(content::kHttpsScheme) &&
+ other_url.SchemeIs(chrome::kHttpScheme)));
+}
+} // namespace
+
+bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) {
+ return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path();
+}
+} // namespace search

Powered by Google App Engine
This is Rietveld 408576698