Commit 50b24896 authored by Dominic Schulz's avatar Dominic Schulz Committed by Commit Bot

Remove redundant check for kChromeUIScheme

We don't need to check if a URL is "HTTP" and then also check that it's
not "chrome://"

Bug: 1044855
Change-Id: Idf843951668d88de831dfe28a4f567f0b9717893
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2185832Reviewed-by: default avatarJeffrey Cohen <jeffreycohen@chromium.org>
Commit-Queue: Dominic Schulz <dominicschulz@google.com>
Cr-Commit-Position: refs/heads/master@{#768535}
parent bdcf01c7
......@@ -42,9 +42,8 @@ bool HasValidTargetDevice(Profile* profile) {
bool AreContentRequirementsMet(const GURL& url, Profile* profile) {
bool is_http_or_https = url.SchemeIsHTTPOrHTTPS();
bool is_native_page = url.SchemeIs(content::kChromeUIScheme);
bool is_incognito_mode = profile->IsIncognitoProfile();
return is_http_or_https && !is_native_page && !is_incognito_mode;
return is_http_or_https && !is_incognito_mode;
}
bool ShouldOfferFeature(content::WebContents* web_contents) {
......
......@@ -91,6 +91,11 @@ TEST_F(SendTabToSelfUtilTest, NotHTTPOrHTTPS) {
EXPECT_FALSE(AreContentRequirementsMet(url_, profile()));
}
TEST_F(SendTabToSelfUtilTest, UntrustedPage) {
url_ = GURL("chrome-untrusted://url");
EXPECT_FALSE(AreContentRequirementsMet(url_, profile()));
}
TEST_F(SendTabToSelfUtilTest, NativePage) {
url_ = GURL("chrome://flags");
EXPECT_FALSE(AreContentRequirementsMet(url_, profile()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment