Commit 276296be authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Enable the Serial API Origin Trial

In addition to setting the Origin Trial feature name inside Blink we now
need to unconditionally enable access to the Serial service and the new
settings pages.

Bug: 967863
Change-Id: I6c21566526e1590d94a6055258f8b2c511f43110
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863360Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707007}
parent 04fbda1c
...@@ -556,7 +556,6 @@ ...@@ -556,7 +556,6 @@
</chooser-exception-list> </chooser-exception-list>
</settings-subpage> </settings-subpage>
</template> </template>
<template is="dom-if" if="[[enableExperimentalWebPlatformFeatures_]]">
<template is="dom-if" route-path="/content/serialPorts" no-search> <template is="dom-if" route-path="/content/serialPorts" no-search>
<settings-subpage page-title="$i18n{siteSettingsSerialPorts}"> <settings-subpage page-title="$i18n{siteSettingsSerialPorts}">
<category-default-setting <category-default-setting
...@@ -571,7 +570,6 @@ ...@@ -571,7 +570,6 @@
</chooser-exception-list> </chooser-exception-list>
</settings-subpage> </settings-subpage>
</template> </template>
</template>
<template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]"> <template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]">
<template is="dom-if" route-path="/content/filesystem" no-search> <template is="dom-if" route-path="/content/filesystem" no-search>
<settings-subpage <settings-subpage
......
...@@ -171,13 +171,11 @@ ...@@ -171,13 +171,11 @@
category="{{ContentSettingsTypes.USB_DEVICES}}" icon="settings:usb" category="{{ContentSettingsTypes.USB_DEVICES}}" icon="settings:usb"
id="usbDevices" label="$i18n{siteSettingsUsbDevices}"> id="usbDevices" label="$i18n{siteSettingsUsbDevices}">
</site-details-permission> </site-details-permission>
<template is="dom-if" if="[[enableExperimentalWebPlatformFeatures_]]">
<site-details-permission <site-details-permission
category="{{ContentSettingsTypes.SERIAL_PORTS}}" category="{{ContentSettingsTypes.SERIAL_PORTS}}"
icon="settings:serial-port" id="serialPorts" icon="settings:serial-port" id="serialPorts"
label="$i18n{siteSettingsSerialPorts}"> label="$i18n{siteSettingsSerialPorts}">
</site-details-permission> </site-details-permission>
</template>
<template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]"> <template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]">
<site-details-permission <site-details-permission
category="{{ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE}}" category="{{ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE}}"
......
...@@ -192,9 +192,6 @@ const SiteSettingsBehaviorImpl = { ...@@ -192,9 +192,6 @@ const SiteSettingsBehaviorImpl = {
} }
}; };
// These categories are gated behind flags. // These categories are gated behind flags.
addOrRemoveSettingWithFlag(
settings.ContentSettingsTypes.SERIAL_PORTS,
'enableExperimentalWebPlatformFeatures');
addOrRemoveSettingWithFlag( addOrRemoveSettingWithFlag(
settings.ContentSettingsTypes.BLUETOOTH_SCANNING, settings.ContentSettingsTypes.BLUETOOTH_SCANNING,
'enableExperimentalWebPlatformFeatures'); 'enableExperimentalWebPlatformFeatures');
......
...@@ -189,7 +189,6 @@ ...@@ -189,7 +189,6 @@
'$i18nPolymer{siteSettingsUsbDevicesAsk}', '$i18nPolymer{siteSettingsUsbDevicesAsk}',
'$i18nPolymer{siteSettingsUsbDevicesBlock}')]]"></cr-link-row> '$i18nPolymer{siteSettingsUsbDevicesBlock}')]]"></cr-link-row>
<template is="dom-if" if="[[enableExperimentalWebPlatformFeatures_]]">
<cr-link-row <cr-link-row
class="hr two-line" class="hr two-line"
data-route="SITE_SETTINGS_SERIAL_PORTS" data-route="SITE_SETTINGS_SERIAL_PORTS"
...@@ -203,7 +202,6 @@ ...@@ -203,7 +202,6 @@
'$i18nPolymer{siteSettingsSerialPortsAsk}', '$i18nPolymer{siteSettingsSerialPortsAsk}',
'$i18nPolymer{siteSettingsSerialPortsBlock}')]]"> '$i18nPolymer{siteSettingsSerialPortsBlock}')]]">
</cr-link-row> </cr-link-row>
</template>
<template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]"> <template is="dom-if" if="[[enableNativeFileSystemWriteContentSetting_]]">
<cr-link-row class="hr two-line" <cr-link-row class="hr two-line"
......
...@@ -136,7 +136,6 @@ suite('SiteDetails', function() { ...@@ -136,7 +136,6 @@ suite('SiteDetails', function() {
settings.ContentSettingsTypes.PROTECTED_CONTENT); settings.ContentSettingsTypes.PROTECTED_CONTENT);
} }
const experimentalSiteDetailsContentSettingsTypes = [ const experimentalSiteDetailsContentSettingsTypes = [
settings.ContentSettingsTypes.SERIAL_PORTS,
settings.ContentSettingsTypes.BLUETOOTH_SCANNING, settings.ContentSettingsTypes.BLUETOOTH_SCANNING,
]; ];
......
...@@ -141,13 +141,6 @@ void BindTextDetection( ...@@ -141,13 +141,6 @@ void BindTextDetection(
GetShapeDetectionService()->BindTextDetection(std::move(receiver)); GetShapeDetectionService()->BindTextDetection(std::move(receiver));
} }
#if !defined(OS_ANDROID)
bool AreExperimentalWebPlatformFeaturesEnabled() {
auto* command_line = base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(
switches::kEnableExperimentalWebPlatformFeatures);
}
#endif
} // namespace } // namespace
// Documents/frames // Documents/frames
...@@ -284,10 +277,8 @@ void PopulateFrameBinders(RenderFrameHostImpl* host, ...@@ -284,10 +277,8 @@ void PopulateFrameBinders(RenderFrameHostImpl* host,
map->Add<blink::mojom::InstalledAppProvider>( map->Add<blink::mojom::InstalledAppProvider>(
base::BindRepeating(&InstalledAppProviderImplDefault::Create)); base::BindRepeating(&InstalledAppProviderImplDefault::Create));
if (AreExperimentalWebPlatformFeaturesEnabled()) {
map->Add<blink::mojom::SerialService>(base::BindRepeating( map->Add<blink::mojom::SerialService>(base::BindRepeating(
&RenderFrameHostImpl::BindSerialService, base::Unretained(host))); &RenderFrameHostImpl::BindSerialService, base::Unretained(host)));
}
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
} }
...@@ -360,10 +351,8 @@ void PopulateDedicatedWorkerBinders(DedicatedWorkerHost* host, ...@@ -360,10 +351,8 @@ void PopulateDedicatedWorkerBinders(DedicatedWorkerHost* host,
&DedicatedWorkerHost::CreateIDBFactory, base::Unretained(host))); &DedicatedWorkerHost::CreateIDBFactory, base::Unretained(host)));
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
if (AreExperimentalWebPlatformFeaturesEnabled()) {
map->Add<blink::mojom::SerialService>(base::BindRepeating( map->Add<blink::mojom::SerialService>(base::BindRepeating(
&DedicatedWorkerHost::BindSerialService, base::Unretained(host))); &DedicatedWorkerHost::BindSerialService, base::Unretained(host)));
}
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
} }
......
...@@ -1484,6 +1484,7 @@ ...@@ -1484,6 +1484,7 @@
}, },
{ {
name: "Serial", name: "Serial",
origin_trial_feature_name: "Serial",
status: {"Android": "", "default": "experimental"}, status: {"Android": "", "default": "experimental"},
}, },
{ {
......
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 Serial --expire-timestamp=2000000000
-- -->
<meta http-equiv="origin-trial" content="At0SGGQC1y/viEH1bb+J0N7TA5ZWcC2RlOG3l/ZpDjqo49ctt3m+xjw0p/Jnxh4IN2F5343SciSAI/cZxA7HHwAAAABOeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiU2VyaWFsIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9" />
<title>Serial - interfaces exposed by origin trial</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/origin-trials-helper.js"></script>
<script>
test(t => {
OriginTrialsHelper.check_properties_exist(this,
{
'Navigator': ['serial'],
'SerialPort': ['close', 'getSignals', 'open', 'readable', 'setSignals',
'writable'],
'Serial': ['getPorts', 'requestPort'],
},
);
}, "Serial related interfaces in Origin-Trial enabled document.");
</script>
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