Commit 301f4d8b authored by Alexander Cooper's avatar Alexander Cooper Committed by Commit Bot

Do not gate AR/VR Permission status on feature state

The WebXrPermissionsApi shipped with M83, as such, the feature flag can
be removed. In order to remove the feature flag, places that rely on it
need to be cleaned up. This change modifies the relevant UI code that
used this state to determine whether or not to show the AR/VR permission
entries. Since the feature is enabled by default, this logic can be
removed and/or defaulted to always appearing.

Change-Id: I7b6dd98da184811eaf65d94076549a23800eb82e
Bug: 1064384
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2215455Reviewed-by: default avatardpapad <dpapad@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773262}
parent 3b59ad16
......@@ -158,9 +158,6 @@ public class ChromeSiteSettingsClient implements SiteSettingsClient {
ContentSwitches.ENABLE_EXPERIMENTAL_WEB_PLATFORM_FEATURES);
case SiteSettingsCategory.Type.NFC:
return ContentFeatureList.isEnabled(ContentFeatureList.WEB_NFC);
case SiteSettingsCategory.Type.AUGMENTED_REALITY: // Fall-through
case SiteSettingsCategory.Type.VIRTUAL_REALITY:
return ContentFeatureList.isEnabled(ContentFeatureList.WEBXR_PERMISSIONS_API);
default:
return true;
}
......
......@@ -22,7 +22,6 @@ import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.test.ChromeBrowserTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.browser.Features.EnableFeatures;
import org.chromium.components.browser_ui.site_settings.ChosenObjectInfo;
import org.chromium.components.browser_ui.site_settings.ContentSettingException;
import org.chromium.components.browser_ui.site_settings.LocalStorageInfo;
......@@ -37,7 +36,6 @@ import org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridgeJ
import org.chromium.components.content_settings.ContentSettingValues;
import org.chromium.components.content_settings.ContentSettingsType;
import org.chromium.components.embedder_support.browser_context.BrowserContextHandle;
import org.chromium.content_public.browser.ContentFeatureList;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import java.util.ArrayList;
......@@ -427,7 +425,6 @@ public class WebsitePermissionsFetcherTest {
@Test
@SmallTest
@EnableFeatures(ContentFeatureList.WEBXR_PERMISSIONS_API)
public void testFetchAllPreferencesForSingleOrigin() {
WebsitePermissionsFetcher fetcher =
new WebsitePermissionsFetcher(UNUSED_BROWSER_CONTEXT_HANDLE);
......@@ -647,7 +644,6 @@ public class WebsitePermissionsFetcherTest {
@Test
@SmallTest
@EnableFeatures(ContentFeatureList.WEBXR_PERMISSIONS_API)
public void testFetchPreferencesForCategoryPermissionInfoTypes() {
WebsitePermissionsFetcher fetcher =
new WebsitePermissionsFetcher(UNUSED_BROWSER_CONTEXT_HANDLE);
......
......@@ -729,43 +729,41 @@
</settings-subpage>
</template>
</template>
<template is="dom-if" if="[[enableWebXrContentSetting_]]">
<template is="dom-if" route-path="/content/vr" no-search>
<settings-subpage page-title="$i18n{siteSettingsVr}"
search-label="$i18n{siteSettingsAllSitesSearch}"
search-term="{{searchFilter_}}">
<category-default-setting
toggle-off-label="$i18n{siteSettingsVrBlock}"
toggle-on-label=
"$i18n{siteSettingsVrAskRecommended}"
category="{{ContentSettingsTypes.VR}}">
</category-default-setting>
<category-setting-exceptions
category="{{ContentSettingsTypes.VR}}"
read-only-list
block-header="$i18n{siteSettingsBlock}"
search-filter="[[searchFilter_]]">
</category-setting-exceptions>
</settings-subpage>
</template>
<template is="dom-if" route-path="/content/ar" no-search>
<settings-subpage page-title="$i18n{siteSettingsAr}"
search-label="$i18n{siteSettingsAllSitesSearch}"
search-term="{{searchFilter_}}">
<category-default-setting
toggle-off-label="$i18n{siteSettingsArBlock}"
toggle-on-label=
"$i18n{siteSettingsArAskRecommended}"
category="{{ContentSettingsTypes.AR}}">
</category-default-setting>
<category-setting-exceptions
category="{{ContentSettingsTypes.AR}}"
read-only-list
block-header="$i18n{siteSettingsBlock}"
search-filter="[[searchFilter_]]">
</category-setting-exceptions>
</settings-subpage>
</template>
<template is="dom-if" route-path="/content/vr" no-search>
<settings-subpage page-title="$i18n{siteSettingsVr}"
search-label="$i18n{siteSettingsAllSitesSearch}"
search-term="{{searchFilter_}}">
<category-default-setting
toggle-off-label="$i18n{siteSettingsVrBlock}"
toggle-on-label=
"$i18n{siteSettingsVrAskRecommended}"
category="{{ContentSettingsTypes.VR}}">
</category-default-setting>
<category-setting-exceptions
category="{{ContentSettingsTypes.VR}}"
read-only-list
block-header="$i18n{siteSettingsBlock}"
search-filter="[[searchFilter_]]">
</category-setting-exceptions>
</settings-subpage>
</template>
<template is="dom-if" route-path="/content/ar" no-search>
<settings-subpage page-title="$i18n{siteSettingsAr}"
search-label="$i18n{siteSettingsAllSitesSearch}"
search-term="{{searchFilter_}}">
<category-default-setting
toggle-off-label="$i18n{siteSettingsArBlock}"
toggle-on-label=
"$i18n{siteSettingsArAskRecommended}"
category="{{ContentSettingsTypes.AR}}">
</category-default-setting>
<category-setting-exceptions
category="{{ContentSettingsTypes.AR}}"
read-only-list
block-header="$i18n{siteSettingsBlock}"
search-filter="[[searchFilter_]]">
</category-setting-exceptions>
</settings-subpage>
</template>
<template is="dom-if" if="[[enableExperimentalWebPlatformFeatures_]]">
<template is="dom-if" route-path="/content/windowPlacement" no-search>
......
......@@ -241,12 +241,6 @@ Polymer({
loadTimeData.getBoolean('enableWebBluetoothNewPermissionsBackend'),
},
/** @private */
enableWebXrContentSetting_: {
type: Boolean,
value: () => loadTimeData.getBoolean('enableWebXrContentSetting'),
},
/** @private {!Map<string, string>} */
focusConfig_: {
type: Object,
......
......@@ -42,9 +42,7 @@ function addPrivacyChildRoutes(r) {
// TODO(tommycli): Find a way to refactor these repetitive category
// routes.
r.SITE_SETTINGS_ADS = r.SITE_SETTINGS.createChild('ads');
if (loadTimeData.getBoolean('enableWebXrContentSetting')) {
r.SITE_SETTINGS_AR = r.SITE_SETTINGS.createChild('ar');
}
r.SITE_SETTINGS_AR = r.SITE_SETTINGS.createChild('ar');
r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS =
r.SITE_SETTINGS.createChild('automaticDownloads');
r.SITE_SETTINGS_BACKGROUND_SYNC =
......@@ -85,9 +83,7 @@ function addPrivacyChildRoutes(r) {
r.SITE_SETTINGS_PAYMENT_HANDLER =
r.SITE_SETTINGS.createChild('paymentHandler');
}
if (loadTimeData.getBoolean('enableWebXrContentSetting')) {
r.SITE_SETTINGS_VR = r.SITE_SETTINGS.createChild('vr');
}
r.SITE_SETTINGS_VR = r.SITE_SETTINGS.createChild('vr');
if (loadTimeData.getBoolean('enableExperimentalWebPlatformFeatures')) {
r.SITE_SETTINGS_BLUETOOTH_SCANNING =
r.SITE_SETTINGS.createChild('bluetoothScanning');
......
......@@ -246,18 +246,16 @@
label="$i18n{siteSettingsInsecureContent}">
</site-details-permission>
</template>
<template is="dom-if" if="[[enableWebXrContentSetting_]]">
<site-details-permission
category="{{ContentSettingsTypes.AR}}"
icon="settings:vr-headset" id="ar"
label="$i18n{siteSettingsAr}">
</site-details-permission>
<site-details-permission
category="{{ContentSettingsTypes.VR}}"
icon="settings:vr-headset" id="vr"
label="$i18n{siteSettingsVr}">
</site-details-permission>
</template>
<site-details-permission
category="{{ContentSettingsTypes.AR}}"
icon="settings:vr-headset" id="ar"
label="$i18n{siteSettingsAr}">
</site-details-permission>
<site-details-permission
category="{{ContentSettingsTypes.VR}}"
icon="settings:vr-headset" id="vr"
label="$i18n{siteSettingsVr}">
</site-details-permission>
<template is="dom-if" if="[[enableExperimentalWebPlatformFeatures_]]">
<site-details-permission
category="{{ContentSettingsTypes.WINDOW_PLACEMENT}}"
......
......@@ -125,12 +125,6 @@ Polymer({
},
},
/** @private */
enableWebXrContentSetting_: {
type: Boolean,
value: () => loadTimeData.getBoolean('enableWebXrContentSetting'),
},
/** @private {string} */
fetchingForHost_: '',
......
......@@ -230,10 +230,6 @@ const SiteSettingsBehaviorImpl = {
addOrRemoveSettingWithFlag(
ContentSettingsTypes.HID_DEVICES,
'enableExperimentalWebPlatformFeatures');
addOrRemoveSettingWithFlag(
ContentSettingsTypes.AR, 'enableWebXrContentSetting');
addOrRemoveSettingWithFlag(
ContentSettingsTypes.VR, 'enableWebXrContentSetting');
addOrRemoveSettingWithFlag(
ContentSettingsTypes.BLUETOOTH_DEVICES,
'enableWebBluetoothNewPermissionsBackend');
......
......@@ -61,7 +61,6 @@ function getCategoryItemMap() {
icon: 'settings:vr-headset',
enabledLabel: 'siteSettingsArAsk',
disabledLabel: 'siteSettingsArBlock',
shouldShow: () => loadTimeData.getBoolean('enableWebXrContentSetting'),
},
{
route: routes.SITE_SETTINGS_AUTOMATIC_DOWNLOADS,
......@@ -299,7 +298,6 @@ function getCategoryItemMap() {
icon: 'settings:vr-headset',
enabledLabel: 'siteSettingsVrAsk',
disabledLabel: 'siteSettingsVrBlock',
shouldShow: () => loadTimeData.getBoolean('enableWebXrContentSetting'),
},
{
route: routes.SITE_SETTINGS_WINDOW_PLACEMENT,
......
......@@ -1940,10 +1940,6 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source,
html_source->AddBoolean("enableWebBluetoothNewPermissionsBackend",
base::FeatureList::IsEnabled(
features::kWebBluetoothNewPermissionsBackend));
html_source->AddBoolean(
"enableWebXrContentSetting",
base::FeatureList::IsEnabled(features::kWebXrPermissionsApi));
}
#if !defined(OS_CHROMEOS)
......
......@@ -228,10 +228,6 @@ suite('SiteDetails', function() {
optionalSiteDetailsContentSettingsTypes[ContentSettingsTypes
.BLUETOOTH_DEVICES] =
'enableWebBluetoothNewPermissionsBackend';
optionalSiteDetailsContentSettingsTypes[ContentSettingsTypes.AR] =
'enableWebXrContentSetting';
optionalSiteDetailsContentSettingsTypes[ContentSettingsTypes.VR] =
'enableWebXrContentSetting';
const controlledSettingsCount = /** @type{string : int } */ ({});
......@@ -241,7 +237,6 @@ suite('SiteDetails', function() {
controlledSettingsCount['enablePaymentHandlerContentSetting'] = 1;
controlledSettingsCount['enableSafeBrowsingSubresourceFilter'] = 1;
controlledSettingsCount['enableWebBluetoothNewPermissionsBackend'] = 1;
controlledSettingsCount['enableWebXrContentSetting'] = 2;
browserProxy.setPrefs(prefs);
......@@ -373,7 +368,6 @@ suite('SiteDetails', function() {
enablePaymentHandlerContentSetting: true,
enableSafeBrowsingSubresourceFilter: true,
enableWebBluetoothNewPermissionsBackend: true,
enableWebXrContentSetting: true,
});
testElement = createSiteDetails('https://foo.com:443');
......
......@@ -140,12 +140,10 @@ public class WebsitePermissionsFetcher {
// NFC permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.NFC));
}
if (ContentFeatureList.isEnabled(ContentFeatureList.WEBXR_PERMISSIONS_API)) {
// VIRTUAL_REALITY permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.VIRTUAL_REALITY));
// AR permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.AUGMENTED_REALITY));
}
// VIRTUAL_REALITY permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.VIRTUAL_REALITY));
// AR permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.AUGMENTED_REALITY));
queue.add(new PermissionsAvailableCallbackRunner(callback));
......@@ -233,15 +231,11 @@ public class WebsitePermissionsFetcher {
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.NFC));
}
} else if (category.showSites(SiteSettingsCategory.Type.VIRTUAL_REALITY)) {
if (ContentFeatureList.isEnabled(ContentFeatureList.WEBXR_PERMISSIONS_API)) {
// VIRTUAL_REALITY permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.VIRTUAL_REALITY));
}
// VIRTUAL_REALITY permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.VIRTUAL_REALITY));
} else if (category.showSites(SiteSettingsCategory.Type.AUGMENTED_REALITY)) {
if (ContentFeatureList.isEnabled(ContentFeatureList.WEBXR_PERMISSIONS_API)) {
// AUGMENTED_REALITY permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.AUGMENTED_REALITY));
}
// AUGMENTED_REALITY permission is per-origin and per-embedder.
queue.add(new PermissionInfoFetcher(PermissionInfo.Type.AUGMENTED_REALITY));
}
queue.add(new PermissionsAvailableCallbackRunner(callback));
queue.next();
......
......@@ -126,10 +126,8 @@ void PageInfoControllerAndroid::SetPermissionInfo(
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
if (cmd->HasSwitch(switches::kEnableExperimentalWebPlatformFeatures))
permissions_to_display.push_back(ContentSettingsType::BLUETOOTH_SCANNING);
if (base::FeatureList::IsEnabled(features::kWebXrPermissionsApi)) {
permissions_to_display.push_back(ContentSettingsType::VR);
permissions_to_display.push_back(ContentSettingsType::AR);
}
permissions_to_display.push_back(ContentSettingsType::VR);
permissions_to_display.push_back(ContentSettingsType::AR);
std::map<ContentSettingsType, ContentSetting>
user_specified_settings_to_display;
......
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