fix: navigator.bluetooth.requestDevice (#27902)

* fix: navigator.bluetooth.requestDevice

* cleanup lint and add test

* update bluetooth test to handle no bluetooth adapter available

* update bluetooth test to handle bluetooth permission denied
This commit is contained in:
John Kleinschmidt 2021-02-26 14:10:27 -05:00 committed by GitHub
parent bd940b2904
commit d57fd6cef0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 269 additions and 2 deletions

View file

@ -19,6 +19,7 @@
#include "electron/buildflags/buildflags.h"
#include "net/ssl/client_cert_identity.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "shell/browser/bluetooth/electron_bluetooth_delegate.h"
#include "shell/browser/serial/electron_serial_delegate.h"
namespace content {
@ -86,6 +87,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
bool CanUseCustomSiteInstance() override;
content::SerialDelegate* GetSerialDelegate() override;
content::BluetoothDelegate* GetBluetoothDelegate() override;
protected:
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
content::SpeechRecognitionManagerDelegate*
@ -335,6 +338,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
uint64_t next_id_ = 0;
std::unique_ptr<ElectronSerialDelegate> serial_delegate_;
std::unique_ptr<ElectronBluetoothDelegate> bluetooth_delegate_;
DISALLOW_COPY_AND_ASSIGN(ElectronBrowserClient);
};