Commit 93e63ac8 authored by Andy Paicu's avatar Andy Paicu Committed by Commit Bot

Remove permission delegation flag

The flag has been enabled by default since M71 and the feature has been
well received by other browers as well as the community.

Bug: 1090670
Change-Id: Ia1e93bae53932b0b6e16b979612afe702c458657
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315016
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarKamila Hasanbega <hkamila@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799098}
parent 4449adaa
......@@ -20,7 +20,6 @@ import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.browser.Features.DisableFeatures;
import org.chromium.chrome.test.util.browser.Features.EnableFeatures;
import org.chromium.components.browser_ui.site_settings.PermissionInfo;
import org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridgeJni;
......@@ -115,23 +114,6 @@ public class PermissionInfoTest {
ContentSettingValues.ASK, getGeolocation(OTHER_ORIGIN, null, incognito));
}
@Test
@SmallTest
@Feature({"Preferences"})
@DisableFeatures(ChromeFeatureList.PERMISSION_DELEGATION)
public void testResetDSEGeolocationEmbeddedOrigin() throws Throwable {
// It's not possible to set a permission for an embedded origin when permission delegation
// is enabled. This code can be deleted when the feature is enabled by default.
// Resetting an embedded DSE origin should not have the same behavior.
boolean incognito = false;
setGeolocation(DSE_ORIGIN, OTHER_ORIGIN, ContentSettingValues.BLOCK, incognito);
Assert.assertEquals(
ContentSettingValues.BLOCK, getGeolocation(DSE_ORIGIN, OTHER_ORIGIN, incognito));
setGeolocation(DSE_ORIGIN, OTHER_ORIGIN, ContentSettingValues.DEFAULT, incognito);
Assert.assertEquals(
ContentSettingValues.ASK, getGeolocation(DSE_ORIGIN, OTHER_ORIGIN, incognito));
}
@Test
@SmallTest
@Feature({"Preferences"})
......
......@@ -88,8 +88,7 @@ scoped_refptr<RefcountedKeyedService>
profile->GetPrefs(),
profile->IsOffTheRecord() || profile->IsGuestSession(),
/*store_last_modified=*/true,
base::FeatureList::IsEnabled(
permissions::features::kPermissionDelegation),
/*migrate_requesting_and_top_level_origin_settings=*/true,
profile->ShouldRestoreOldSessionCookies()));
auto allowlist_provider = std::make_unique<WebUIAllowlistProvider>(
......
......@@ -269,9 +269,7 @@ ContentSettingsContentSettingSetFunction::Run() {
if (primary_pattern != secondary_pattern &&
secondary_pattern != ContentSettingsPattern::Wildcard() &&
!info->website_settings_info()->SupportsEmbeddedExceptions() &&
base::FeatureList::IsEnabled(
permissions::features::kPermissionDelegation)) {
!info->website_settings_info()->SupportsEmbeddedExceptions()) {
static const char kUnsupportedEmbeddedException[] =
"Embedded patterns are not supported for this setting.";
return RespondNow(Error(kUnsupportedEmbeddedException));
......
......@@ -278,15 +278,11 @@ class ExtensionContentSettingsApiLazyTest
protected:
bool RunLazyTest(const std::string& extension_name) {
return RunLazyTestWithArg(extension_name, nullptr);
}
bool RunLazyTestWithArg(const std::string& extension_name, const char* arg) {
int browser_test_flags = kFlagNone;
if (GetParam() == ContextType::kServiceWorker)
browser_test_flags |= kFlagRunAsServiceWorkerBasedExtension;
return RunExtensionTestWithFlagsAndArg(extension_name, arg,
return RunExtensionTestWithFlagsAndArg(extension_name, nullptr,
browser_test_flags, kFlagNone);
}
......@@ -435,64 +431,6 @@ IN_PROC_BROWSER_TEST_P(ExtensionContentSettingsApiLazyTest,
"ContentSettings.ExtensionNonEmbeddedSettingSet", 2);
}
class ExtensionContentSettingsApiTestWithPermissionDelegationDisabled
: public ExtensionContentSettingsApiLazyTest {
public:
ExtensionContentSettingsApiTestWithPermissionDelegationDisabled() {
feature_list_.InitAndDisableFeature(
permissions::features::kPermissionDelegation);
}
private:
base::test::ScopedFeatureList feature_list_;
};
INSTANTIATE_TEST_SUITE_P(
EventPage,
ExtensionContentSettingsApiTestWithPermissionDelegationDisabled,
::testing::Values(ContextType::kEventPage));
INSTANTIATE_TEST_SUITE_P(
ServiceWorker,
ExtensionContentSettingsApiTestWithPermissionDelegationDisabled,
::testing::Values(ContextType::kServiceWorker));
class ExtensionContentSettingsApiTestWithPermissionDelegationEnabled
: public ExtensionContentSettingsApiLazyTest {
public:
ExtensionContentSettingsApiTestWithPermissionDelegationEnabled() {
feature_list_.InitAndEnableFeature(
permissions::features::kPermissionDelegation);
}
private:
base::test::ScopedFeatureList feature_list_;
};
INSTANTIATE_TEST_SUITE_P(
EventPage,
ExtensionContentSettingsApiTestWithPermissionDelegationEnabled,
::testing::Values(ContextType::kEventPage));
INSTANTIATE_TEST_SUITE_P(
ServiceWorker,
ExtensionContentSettingsApiTestWithPermissionDelegationEnabled,
::testing::Values(ContextType::kServiceWorker));
IN_PROC_BROWSER_TEST_P(
ExtensionContentSettingsApiTestWithPermissionDelegationDisabled,
EmbeddedSettings) {
const char kExtensionPath[] = "content_settings/embeddedsettings";
EXPECT_TRUE(RunLazyTestWithArg(kExtensionPath, nullptr)) << message_;
}
IN_PROC_BROWSER_TEST_P(
ExtensionContentSettingsApiTestWithPermissionDelegationEnabled,
EmbeddedSettings) {
const char kExtensionPath[] = "content_settings/embeddedsettings";
EXPECT_TRUE(RunLazyTestWithArg(kExtensionPath, "permission")) << message_;
}
class ExtensionContentSettingsApiTestWithWildcardMatchingDisabled
: public ExtensionContentSettingsApiLazyTest {
public:
......
......@@ -446,9 +446,7 @@ void ContentSettingsStore::SetExtensionContentSettingFromList(
content_settings_type);
if (primary_pattern != secondary_pattern &&
secondary_pattern != ContentSettingsPattern::Wildcard() &&
!info->website_settings_info()->SupportsEmbeddedExceptions() &&
base::FeatureList::IsEnabled(
permissions::features::kPermissionDelegation)) {
!info->website_settings_info()->SupportsEmbeddedExceptions()) {
// Some types may have had embedded exceptions written even though they
// aren't supported. This will implicitly delete these old settings from
// the pref store when it is written back.
......
......@@ -313,7 +313,7 @@ TEST_F(ContentSettingsStoreTest, RemoveEmbedded) {
ContentSettingsPattern::FromURL(primary_url);
ContentSettingsPattern secondary_pattern =
ContentSettingsPattern::FromURL(secondary_url);
EXPECT_CALL(observer, OnContentSettingChanged(ext_id, false)).Times(4);
EXPECT_CALL(observer, OnContentSettingChanged(ext_id, false)).Times(1);
// Build a preference list in JSON format.
base::ListValue pref_list;
......@@ -333,43 +333,18 @@ TEST_F(ContentSettingsStoreTest, RemoveEmbedded) {
dict_value->SetString(keys::kContentSettingKey, "allow");
pref_list.Append(std::move(dict_value));
{
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(
permissions::features::kPermissionDelegation);
store()->SetExtensionContentSettingFromList(ext_id, &pref_list,
kExtensionPrefsScopeRegular);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
GetContentSettingFromStore(store(), primary_url, secondary_url,
ContentSettingsType::COOKIES,
std::string(), false));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
GetContentSettingFromStore(store(), primary_url, secondary_url,
ContentSettingsType::GEOLOCATION,
std::string(), false));
store()->ClearContentSettingsForExtension(ext_id,
store()->SetExtensionContentSettingFromList(ext_id, &pref_list,
kExtensionPrefsScopeRegular);
}
{
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(
permissions::features::kPermissionDelegation);
store()->SetExtensionContentSettingFromList(ext_id, &pref_list,
kExtensionPrefsScopeRegular);
// The embedded geolocation pattern should be removed but cookies kept.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
GetContentSettingFromStore(store(), primary_url, secondary_url,
ContentSettingsType::COOKIES,
std::string(), false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
GetContentSettingFromStore(store(), primary_url, secondary_url,
ContentSettingsType::GEOLOCATION,
std::string(), false));
}
// The embedded geolocation pattern should be removed but cookies kept.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
GetContentSettingFromStore(store(), primary_url, secondary_url,
ContentSettingsType::COOKIES,
std::string(), false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
GetContentSettingFromStore(store(), primary_url, secondary_url,
ContentSettingsType::GEOLOCATION,
std::string(), false));
Mock::VerifyAndClear(&observer);
store()->RemoveObserver(&observer);
......
......@@ -228,7 +228,6 @@ const base::Feature* kFeaturesExposedToJava[] = {
&net::features::kCookiesWithoutSameSiteMustBeSecure,
&paint_preview::kPaintPreviewDemo,
&paint_preview::kPaintPreviewShowOnStartup,
&permissions::features::kPermissionDelegation,
&language::kExplicitLanguageAsk,
&ntp_snippets::kArticleSuggestionsFeature,
&offline_pages::kOfflineIndicatorFeature,
......
......@@ -510,53 +510,6 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, NoLeakFromOffTheRecord) {
ExpectPosition(fake_latitude(), fake_longitude());
}
// When permission delegation is enabled, there isn't a way to have a pending
// permission prompt when permission has already been granted in another frame
// on the same page. That means that once the feature is enabled by default,
// tests which use this fixture are no longer relevant and can be deleted.
class GeolocationBrowserTestWithNoPermissionDelegation
: public GeolocationBrowserTest {
public:
GeolocationBrowserTestWithNoPermissionDelegation() {
feature_list_.InitAndDisableFeature(
permissions::features::kPermissionDelegation);
}
private:
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTestWithNoPermissionDelegation,
IFramesWithFreshPosition) {
set_html_for_tests("/geolocation/two_iframes.html");
ASSERT_NO_FATAL_FAILURE(Initialize(INITIALIZATION_DEFAULT));
LoadIFrames();
// Grant permission in the first frame, the position gets to the script.
SetFrameForScriptExecution("iframe_0");
ASSERT_TRUE(WatchPositionAndGrantPermission());
ExpectPosition(fake_latitude(), fake_longitude());
// In a second iframe from a different origin with a cached position the
// user is prompted.
SetFrameForScriptExecution("iframe_1");
WatchPositionAndObservePermissionRequest(true);
// Back to the first frame, enable navigation and refresh geoposition.
SetFrameForScriptExecution("iframe_0");
double fresh_position_latitude = 3.17;
double fresh_position_longitude = 4.23;
ASSERT_TRUE(SetPositionAndWaitUntilUpdated(fresh_position_latitude,
fresh_position_longitude));
ExpectPosition(fresh_position_latitude, fresh_position_longitude);
// When permission is granted to the second iframe the fresh position gets
// to the script.
SetFrameForScriptExecution("iframe_1");
ASSERT_TRUE(WatchPositionAndGrantPermission());
ExpectPosition(fresh_position_latitude, fresh_position_longitude);
}
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, IFramesWithCachedPosition) {
set_html_for_tests("/geolocation/two_iframes.html");
ASSERT_NO_FATAL_FAILURE(Initialize(INITIALIZATION_DEFAULT));
......@@ -581,30 +534,6 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, IFramesWithCachedPosition) {
ExpectPosition(cached_position_latitude, cached_position_lognitude);
}
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTestWithNoPermissionDelegation,
CancelPermissionForFrame) {
set_html_for_tests("/geolocation/two_iframes.html");
ASSERT_NO_FATAL_FAILURE(Initialize(INITIALIZATION_DEFAULT));
LoadIFrames();
SetFrameForScriptExecution("iframe_0");
ASSERT_TRUE(WatchPositionAndGrantPermission());
ExpectPosition(fake_latitude(), fake_longitude());
// Test second iframe from a different origin with a cached position will
// create the prompt.
SetFrameForScriptExecution("iframe_1");
WatchPositionAndObservePermissionRequest(true);
// Navigate the iframe, and ensure the prompt is gone.
content::WebContents* web_contents =
current_browser()->tab_strip_model()->GetActiveWebContents();
IFrameLoader change_iframe_1(current_browser(), 1, current_url());
int num_requests_after_cancel = GetRequestQueueSize(
permissions::PermissionRequestManager::FromWebContents(web_contents));
EXPECT_EQ(0, num_requests_after_cancel);
}
IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, InvalidUrlRequest) {
// Tests that an invalid URL (e.g. from a popup window) is rejected
// correctly. Also acts as a regression test for http://crbug.com/40478
......
......@@ -99,40 +99,18 @@ TEST_F(ChromePermissionManagerTest, GetCanonicalOriginPermissionDelegation) {
const GURL extensions_requesting_origin(
"chrome-extension://abcdefghijklmnopqrstuvxyz");
{
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(
permissions::features::kPermissionDelegation);
// Without permission delegation enabled the requesting origin should always
// be returned.
EXPECT_EQ(requesting_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::GEOLOCATION, requesting_origin,
embedding_origin));
EXPECT_EQ(extensions_requesting_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::GEOLOCATION,
extensions_requesting_origin, embedding_origin));
}
{
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(
permissions::features::kPermissionDelegation);
// With permission delegation, the embedding origin should be returned
// except in the case of extensions; and except for notifications, for which
// permission delegation is always off.
EXPECT_EQ(embedding_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::GEOLOCATION, requesting_origin,
embedding_origin));
EXPECT_EQ(extensions_requesting_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::GEOLOCATION,
extensions_requesting_origin, embedding_origin));
EXPECT_EQ(requesting_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::NOTIFICATIONS, requesting_origin,
embedding_origin));
}
// The embedding origin should be returned
// except in the case of extensions and notifications.
EXPECT_EQ(embedding_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::GEOLOCATION, requesting_origin,
embedding_origin));
EXPECT_EQ(extensions_requesting_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::GEOLOCATION, extensions_requesting_origin,
embedding_origin));
EXPECT_EQ(requesting_origin,
GetPermissionControllerDelegate()->GetCanonicalOrigin(
ContentSettingsType::NOTIFICATIONS, requesting_origin,
embedding_origin));
}
......@@ -258,11 +258,10 @@ base::Optional<GURL> ChromePermissionsClient::OverrideCanonicalOrigin(
// when in embedded in non-secure contexts. This is unfortunate and we
// should remove this at some point, but for now always use the requesting
// origin for embedded extensions. https://crbug.com/530507.
if (base::FeatureList::IsEnabled(
permissions::features::kPermissionDelegation) &&
requesting_origin.SchemeIs(extensions::kExtensionScheme)) {
if (requesting_origin.SchemeIs(extensions::kExtensionScheme)) {
return requesting_origin;
}
return base::nullopt;
}
......
......@@ -22,10 +22,7 @@ class PermissionDelegationBrowserTest : public InProcessBrowserTest {
public:
PermissionDelegationBrowserTest()
: geolocation_overrider_(
std::make_unique<device::ScopedGeolocationOverrider>(0, 0)) {
scoped_feature_list_.InitAndEnableFeature(
permissions::features::kPermissionDelegation);
}
std::make_unique<device::ScopedGeolocationOverrider>(0, 0)) {}
~PermissionDelegationBrowserTest() override = default;
......@@ -73,7 +70,6 @@ class PermissionDelegationBrowserTest : public InProcessBrowserTest {
mock_permission_prompt_factory_;
std::unique_ptr<net::EmbeddedTestServer> https_embedded_test_server_;
std::unique_ptr<device::ScopedGeolocationOverrider> geolocation_overrider_;
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(PermissionDelegationBrowserTest);
};
......
......@@ -847,58 +847,6 @@ TEST_F(GeolocationPermissionContextTests, LSDBackOffAcceptLSDResetsBackOff) {
#endif
TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
// With permission delegation enabled, there can't be multiple permission
// requests on the same page. This test can be deleted once the feature is
// enabled by default.
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(features::kPermissionDelegation);
GURL requesting_frame_0("https://www.example.com/geolocation");
GURL requesting_frame_1("https://www.example-2.com/geolocation");
EXPECT_EQ(CONTENT_SETTING_ASK, GetGeolocationContentSetting(
requesting_frame_0, requesting_frame_1));
EXPECT_EQ(CONTENT_SETTING_ASK, GetGeolocationContentSetting(
requesting_frame_1, requesting_frame_1));
NavigateAndCommit(requesting_frame_0);
RequestManagerDocumentLoadCompleted();
// Check that no permission requests have happened yet.
EXPECT_FALSE(HasActivePrompt());
// Request permission for two frames.
RequestGeolocationPermission(web_contents(), RequestID(0), requesting_frame_0,
true);
RequestGeolocationPermission(web_contents(), RequestID(1), requesting_frame_1,
true);
// Ensure only one prompt is created.
ASSERT_TRUE(HasActivePrompt());
base::string16 text_0 = GetPromptText();
// Accept the first frame.
AcceptPrompt();
CheckTabContentsState(requesting_frame_0, CONTENT_SETTING_ALLOW);
CheckPermissionMessageSent(0, true);
// Now we should have a new prompt for the second frame.
ASSERT_TRUE(HasActivePrompt());
base::string16 text_1 = GetPromptText();
// Check that the messages differ.
EXPECT_NE(text_0, text_1);
// Cancel (block) this frame.
DenyPrompt();
CheckTabContentsState(requesting_frame_1, CONTENT_SETTING_BLOCK);
CheckPermissionMessageSent(1, false);
// Ensure the persisted permissions are ok.
EXPECT_EQ(CONTENT_SETTING_ALLOW, GetGeolocationContentSetting(
requesting_frame_0, requesting_frame_0));
EXPECT_EQ(CONTENT_SETTING_BLOCK, GetGeolocationContentSetting(
requesting_frame_1, requesting_frame_0));
}
TEST_F(GeolocationPermissionContextTests, HashIsIgnored) {
GURL url_a("https://www.example.com/geolocation#a");
GURL url_b("https://www.example.com/geolocation#b");
......@@ -1018,47 +966,6 @@ TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) {
ASSERT_TRUE(HasActivePrompt(extra_tabs_[1].get()));
}
TEST_F(GeolocationPermissionContextTests, QueuedOriginMultipleTabs) {
// With permission delegation enabled, there can't be multiple permission
// requests on the same page. This test can be deleted once the feature is
// enabled by default.
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(features::kPermissionDelegation);
GURL url_a("https://www.example.com/geolocation");
GURL url_b("https://www.example-2.com/geolocation");
NavigateAndCommit(url_a); // Tab A0.
AddNewTab(url_a); // Tab A1.
RequestManagerDocumentLoadCompleted();
RequestManagerDocumentLoadCompleted(extra_tabs_[0].get());
// Request permission in both tabs; the extra tab will have two permission
// requests from two origins.
RequestGeolocationPermission(web_contents(), RequestID(0), url_a, true);
RequestGeolocationPermission(extra_tabs_[0].get(), RequestIDForTab(0, 0),
url_a, true);
RequestGeolocationPermission(extra_tabs_[0].get(), RequestIDForTab(0, 1),
url_b, true);
ASSERT_TRUE(HasActivePrompt());
ASSERT_TRUE(HasActivePrompt(extra_tabs_[0].get()));
// Accept the first request in tab A1.
AcceptPrompt(extra_tabs_[0].get());
CheckPermissionMessageSentForTab(0, 0, true);
// Because they're the same origin, this should cause tab A0's prompt to
// disappear, but it doesn't : crbug.com/443013.
// TODO(felt): Update this test when the bubble's behavior is changed.
EXPECT_TRUE(HasActivePrompt());
// The second request should now be visible in tab A1.
ASSERT_TRUE(HasActivePrompt(extra_tabs_[0].get()));
// Accept the second request and check that it's gone.
AcceptPrompt(extra_tabs_[0].get());
EXPECT_FALSE(HasActivePrompt(extra_tabs_[0].get()));
}
TEST_F(GeolocationPermissionContextTests, TabDestroyed) {
GURL requesting_frame("https://www.example.com/geolocation");
EXPECT_EQ(CONTENT_SETTING_ASK,
......
......@@ -24,10 +24,5 @@ const base::Feature kBlockRepeatedNotificationPermissionPrompts{
"BlockRepeatedNotificationPermissionPrompts",
base::FEATURE_ENABLED_BY_DEFAULT};
// Delegate permissions to cross-origin iframes when the feature has been
// allowed by feature policy.
const base::Feature kPermissionDelegation{"PermissionDelegation",
base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features
} // namespace permissions
......@@ -13,7 +13,6 @@ namespace features {
extern const base::Feature kBlockPromptsIfDismissedOften;
extern const base::Feature kBlockPromptsIfIgnoredOften;
extern const base::Feature kBlockRepeatedNotificationPermissionPrompts;
extern const base::Feature kPermissionDelegation;
} // namespace features
} // namespace permissions
......
......@@ -356,8 +356,7 @@ void PermissionContextBase::DecidePermission(
// origin displayed in the prompt should never differ from the top-level
// origin. Storage access API requests are excluded as they are expected to
// request permissions from the frame origin needing access.
DCHECK(!base::FeatureList::IsEnabled(features::kPermissionDelegation) ||
PermissionsClient::Get()->CanBypassEmbeddingOriginCheck(
DCHECK(PermissionsClient::Get()->CanBypassEmbeddingOriginCheck(
requesting_origin, embedding_origin) ||
requesting_origin == embedding_origin ||
content_settings_type_ == ContentSettingsType::STORAGE_ACCESS);
......
......@@ -317,14 +317,7 @@ GURL PermissionManager::GetCanonicalOrigin(ContentSettingsType permission,
if (permission == ContentSettingsType::STORAGE_ACCESS)
return requesting_origin;
if (base::FeatureList::IsEnabled(features::kPermissionDelegation)) {
// Once permission delegation is enabled by default, it may be possible to
// remove "embedding_origin" as a parameter from all function calls in
// PermissionContextBase and subclasses. The embedding origin will always
// match the requesting origin.
return embedding_origin;
}
return requesting_origin;
return embedding_origin;
}
int PermissionManager::RequestPermission(
......@@ -400,8 +393,7 @@ PermissionResult PermissionManager::GetPermissionStatus(
// called for the top level origin (or a service worker origin).
// GetPermissionStatusForFrame should be called when to determine the status
// for an embedded frame.
DCHECK(!base::FeatureList::IsEnabled(features::kPermissionDelegation) ||
requesting_origin == embedding_origin);
DCHECK_EQ(requesting_origin, embedding_origin);
return GetPermissionStatusHelper(permission, nullptr /* render_frame_host */,
requesting_origin, embedding_origin);
......
......@@ -694,9 +694,6 @@ TEST_F(PermissionManagerTest, GetPermissionStatusDelegation) {
const char* kOrigin1 = "https://example.com";
const char* kOrigin2 = "https://google.com";
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kPermissionDelegation);
NavigateAndCommit(GURL(kOrigin1));
content::RenderFrameHost* parent = main_rfh();
......@@ -789,9 +786,6 @@ TEST_F(PermissionManagerTest, SubscribeWithPermissionDelegation) {
const char* kOrigin1 = "https://example.com";
const char* kOrigin2 = "https://google.com";
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kPermissionDelegation);
NavigateAndCommit(GURL(kOrigin1));
content::RenderFrameHost* parent = main_rfh();
content::RenderFrameHost* child = AddChildRFH(parent, kOrigin2);
......
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