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

Unified Diff: third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp

Issue 2864723002: Enable Feature policy without experimental features or fullscreen (Closed)
Patch Set: Update layout test expectations Created 3 years, 7 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 | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
index f89c965b35075a0057e00fe885d3e977f2c26074..4ce9979a2b65ef59e59a304dbb6544df37df2f02 100644
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -110,9 +110,10 @@ WebParsedFeaturePolicy GetContainerPolicyFromAllowedFeatures(
// "allowpaymentrequest" policies.
if (feature == WebFeaturePolicyFeature::kPayment)
override_payment = true;
- if (feature == WebFeaturePolicyFeature::kFullscreen)
- override_fullscreen = true;
-
+ if (RuntimeEnabledFeatures::fullscreenInFeaturePolicyEnabled()) {
+ if (feature == WebFeaturePolicyFeature::kFullscreen)
+ override_fullscreen = true;
+ }
WebParsedFeaturePolicyDeclaration whitelist;
whitelist.feature = feature;
whitelist.origins = Vector<WebSecurityOrigin>(1UL, {origin});
@@ -122,8 +123,10 @@ WebParsedFeaturePolicy GetContainerPolicyFromAllowedFeatures(
// enable the feature for all origins; similarly for allowpaymentrequest.
if (allowpayment && !override_payment)
AddAllowFeatureToList(WebFeaturePolicyFeature::kPayment, whitelists);
- if (allowfullscreen && !override_fullscreen)
- AddAllowFeatureToList(WebFeaturePolicyFeature::kFullscreen, whitelists);
+ if (RuntimeEnabledFeatures::fullscreenInFeaturePolicyEnabled()) {
+ if (allowfullscreen && !override_fullscreen)
+ AddAllowFeatureToList(WebFeaturePolicyFeature::kFullscreen, whitelists);
+ }
return whitelists;
}
@@ -131,9 +134,11 @@ WebParsedFeaturePolicy GetContainerPolicyFromAllowedFeatures(
const FeatureNameMap& GetDefaultFeatureNameMap() {
DEFINE_STATIC_LOCAL(FeatureNameMap, default_feature_name_map, ());
if (default_feature_name_map.IsEmpty()) {
- default_feature_name_map.Set("fullscreen",
- WebFeaturePolicyFeature::kFullscreen);
default_feature_name_map.Set("payment", WebFeaturePolicyFeature::kPayment);
+ if (RuntimeEnabledFeatures::fullscreenInFeaturePolicyEnabled()) {
+ default_feature_name_map.Set("fullscreen",
+ WebFeaturePolicyFeature::kFullscreen);
+ }
if (RuntimeEnabledFeatures::featurePolicyExperimentalFeaturesEnabled()) {
default_feature_name_map.Set("vibrate",
WebFeaturePolicyFeature::kVibrate);
« no previous file with comments | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698