chore: remove experimental from navigator.serial implementation (#30237)

This commit is contained in:
John Kleinschmidt 2021-07-29 19:57:22 -04:00 committed by GitHub
parent 3ee6326b93
commit 9cc1b55663
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 27 deletions

View file

@ -14,12 +14,6 @@
#include "shell/browser/serial/serial_chooser_controller.h"
#include "shell/browser/web_contents_permission_helper.h"
namespace features {
const base::Feature kElectronSerialChooser{"ElectronSerialChooser",
base::FEATURE_DISABLED_BY_DEFAULT};
}
namespace electron {
SerialChooserContext* GetChooserContext(content::RenderFrameHost* frame) {
@ -36,16 +30,11 @@ std::unique_ptr<content::SerialChooser> ElectronSerialDelegate::RunChooser(
content::RenderFrameHost* frame,
std::vector<blink::mojom::SerialPortFilterPtr> filters,
content::SerialChooser::Callback callback) {
if (base::FeatureList::IsEnabled(features::kElectronSerialChooser)) {
SerialChooserController* controller = ControllerForFrame(frame);
if (controller) {
DeleteControllerForFrame(frame);
}
AddControllerForFrame(frame, std::move(filters), std::move(callback));
} else {
// If feature is disabled, immediately return back with no port selected.
std::move(callback).Run(nullptr);
SerialChooserController* controller = ControllerForFrame(frame);
if (controller) {
DeleteControllerForFrame(frame);
}
AddControllerForFrame(frame, std::move(filters), std::move(callback));
// Return a nullptr because the return value isn't used for anything, eg
// there is no mechanism to cancel navigator.serial.requestPort(). The return