#include "chrome/browser/serial/chrome_serial_delegate.h"
#include <utility>
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/serial/serial_chooser_context.h"
#include "chrome/browser/serial/serial_chooser_context_factory.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/serial/serial_chooser.h"
#include "chrome/browser/ui/serial/serial_chooser_controller.h"
#include "content/public/browser/render_frame_host.h"
namespace {
SerialChooserContext* GetChooserContext(content::RenderFrameHost* frame) { … }
}
ChromeSerialDelegate::ChromeSerialDelegate() = default;
ChromeSerialDelegate::~ChromeSerialDelegate() = default;
std::unique_ptr<content::SerialChooser> ChromeSerialDelegate::RunChooser(
content::RenderFrameHost* frame,
std::vector<blink::mojom::SerialPortFilterPtr> filters,
std::vector<device::BluetoothUUID> allowed_bluetooth_service_class_ids,
content::SerialChooser::Callback callback) { … }
bool ChromeSerialDelegate::CanRequestPortPermission(
content::RenderFrameHost* frame) { … }
bool ChromeSerialDelegate::HasPortPermission(
content::RenderFrameHost* frame,
const device::mojom::SerialPortInfo& port) { … }
void ChromeSerialDelegate::RevokePortPermissionWebInitiated(
content::RenderFrameHost* frame,
const base::UnguessableToken& token) { … }
const device::mojom::SerialPortInfo* ChromeSerialDelegate::GetPortInfo(
content::RenderFrameHost* frame,
const base::UnguessableToken& token) { … }
device::mojom::SerialPortManager* ChromeSerialDelegate::GetPortManager(
content::RenderFrameHost* frame) { … }
void ChromeSerialDelegate::AddObserver(content::RenderFrameHost* frame,
Observer* observer) { … }
void ChromeSerialDelegate::RemoveObserver(content::RenderFrameHost* frame,
Observer* observer) { … }