Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2021 The Chromium Authors |
Michael van Ouwerkerk | ed90512 | 2021-07-22 14:24:39 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_BLUETOOTH_CHROME_BLUETOOTH_DELEGATE_IMPL_CLIENT_H_ |
| 6 | #define CHROME_BROWSER_BLUETOOTH_CHROME_BLUETOOTH_DELEGATE_IMPL_CLIENT_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | |
| 10 | #include "components/permissions/bluetooth_chooser_controller.h" |
| 11 | #include "components/permissions/bluetooth_delegate_impl.h" |
| 12 | #include "content/public/browser/bluetooth_delegate.h" |
| 13 | |
| 14 | namespace content { |
| 15 | class RenderFrameHost; |
| 16 | } // namespace content |
| 17 | |
| 18 | namespace permissions { |
| 19 | class BluetoothChooserContext; |
| 20 | } // namespace permissions |
| 21 | |
| 22 | // Provides embedder-level functionality to BluetoothDelegateImpl in Chrome. |
| 23 | class ChromeBluetoothDelegateImplClient |
| 24 | : public permissions::BluetoothDelegateImpl::Client { |
| 25 | public: |
| 26 | ChromeBluetoothDelegateImplClient(); |
| 27 | ~ChromeBluetoothDelegateImplClient() override; |
| 28 | |
| 29 | ChromeBluetoothDelegateImplClient(const ChromeBluetoothDelegateImplClient&) = |
| 30 | delete; |
| 31 | ChromeBluetoothDelegateImplClient& operator=( |
| 32 | const ChromeBluetoothDelegateImplClient&) = delete; |
| 33 | |
| 34 | // BluetoothDelegateImpl::Client implementation: |
| 35 | permissions::BluetoothChooserContext* GetBluetoothChooserContext( |
| 36 | content::RenderFrameHost* frame) override; |
| 37 | std::unique_ptr<content::BluetoothChooser> RunBluetoothChooser( |
| 38 | content::RenderFrameHost* frame, |
| 39 | const content::BluetoothChooser::EventHandler& event_handler) override; |
| 40 | std::unique_ptr<content::BluetoothScanningPrompt> ShowBluetoothScanningPrompt( |
| 41 | content::RenderFrameHost* frame, |
| 42 | const content::BluetoothScanningPrompt::EventHandler& event_handler) |
| 43 | override; |
Alvin Ji | f610013 | 2022-07-07 21:53:43 | [diff] [blame] | 44 | |
| 45 | void ShowBluetoothDevicePairDialog( |
Chris Mumford | 4d1cf30 | 2021-10-05 23:02:47 | [diff] [blame] | 46 | content::RenderFrameHost* frame, |
| 47 | const std::u16string& device_identifier, |
Alvin Ji | f610013 | 2022-07-07 21:53:43 | [diff] [blame] | 48 | content::BluetoothDelegate::PairPromptCallback callback, |
Alvin Ji | bab887b | 2022-07-27 00:59:54 | [diff] [blame] | 49 | content::BluetoothDelegate::PairingKind pairing_kind, |
Arthur Sonzogni | fe132ee | 2024-01-15 11:01:04 | [diff] [blame] | 50 | const std::optional<std::u16string>& pin) override; |
Michael van Ouwerkerk | ed90512 | 2021-07-22 14:24:39 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | #endif // CHROME_BROWSER_BLUETOOTH_CHROME_BLUETOOTH_DELEGATE_IMPL_CLIENT_H_ |