From 66dec24e32a001d3517461b78bf7e9f488bb4e62 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 20 Mar 2024 15:18:41 +0100 Subject: [PATCH] fix: `serial-port-added` should respect filters (#41621) fix: serial-port-added should respect filters --- shell/browser/serial/serial_chooser_controller.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/browser/serial/serial_chooser_controller.cc b/shell/browser/serial/serial_chooser_controller.cc index 66a8ea034ee..5ced11ce5f4 100644 --- a/shell/browser/serial/serial_chooser_controller.cc +++ b/shell/browser/serial/serial_chooser_controller.cc @@ -93,6 +93,9 @@ api::Session* SerialChooserController::GetSession() { void SerialChooserController::OnPortAdded( const device::mojom::SerialPortInfo& port) { + if (!FilterMatchesAny(port)) + return; + ports_.push_back(port.Clone()); api::Session* session = GetSession(); if (session) {