Reilly Grant | 0d28232 | 2019-01-29 02:42:58 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 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_SERIAL_CHROME_SERIAL_DELEGATE_H_ |
| 6 | #define CHROME_BROWSER_SERIAL_CHROME_SERIAL_DELEGATE_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "content/public/browser/serial_delegate.h" |
| 12 | |
| 13 | class ChromeSerialDelegate : public content::SerialDelegate { |
| 14 | public: |
| 15 | ChromeSerialDelegate(); |
| 16 | ~ChromeSerialDelegate() override; |
| 17 | |
| 18 | std::unique_ptr<content::SerialChooser> RunChooser( |
| 19 | content::RenderFrameHost* frame, |
| 20 | std::vector<blink::mojom::SerialPortFilterPtr> filters, |
| 21 | content::SerialChooser::Callback callback) override; |
Reilly Grant | 87d6eb02 | 2019-04-19 23:55:59 | [diff] [blame] | 22 | bool CanRequestPortPermission(content::RenderFrameHost* frame) override; |
Reilly Grant | 0d28232 | 2019-01-29 02:42:58 | [diff] [blame] | 23 | bool HasPortPermission(content::RenderFrameHost* frame, |
| 24 | const device::mojom::SerialPortInfo& port) override; |
| 25 | device::mojom::SerialPortManager* GetPortManager( |
| 26 | content::RenderFrameHost* frame) override; |
| 27 | |
| 28 | private: |
| 29 | DISALLOW_COPY_AND_ASSIGN(ChromeSerialDelegate); |
| 30 | }; |
| 31 | |
| 32 | #endif // CHROME_BROWSER_SERIAL_CHROME_SERIAL_DELEGATE_H_ |