This source file includes following definitions.
- MatchesOrigin
- MatchesOriginAndPath
#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(content::kHttpScheme)));
}
}
bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) {
return MatchesOrigin(my_url, other_url) && my_url.path() == other_url.path();
}
}