Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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_USB_WEB_USB_PERMISSION_PROVIDER_H_ | |
| 6 #define CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ | |
| 7 | |
| 8 #include "device/devices_app/usb/public/interfaces/permission_provider.mojom.h" | |
| 9 #include "third_party/mojo/src/mojo/public/cpp/bindings/array.h" | |
| 10 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" | |
| 11 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | |
| 12 | |
| 13 namespace content { | |
| 14 class RenderFrameHost; | |
| 15 } | |
| 16 | |
| 17 namespace chrome { | |
|
Lei Zhang
2015/09/05 00:24:20
no namespace chrome
Reilly Grant (use Gerrit)
2015/09/05 00:56:25
Done.
| |
| 18 | |
| 19 class WebUSBPermissionProvider : public device::usb::PermissionProvider { | |
| 20 public: | |
| 21 static void Create( | |
|
Lei Zhang
2015/09/05 00:24:20
Why have Create() and a public ctor?
Reilly Grant (use Gerrit)
2015/09/05 00:56:25
The AddService method called in chrome_content_bro
Lei Zhang
2015/09/05 01:18:14
Can you make the ctor private with a comment to us
| |
| 22 content::RenderFrameHost* render_frame_host, | |
| 23 mojo::InterfaceRequest<device::usb::PermissionProvider> request); | |
| 24 | |
| 25 WebUSBPermissionProvider(content::RenderFrameHost* render_frame_host, | |
| 26 mojo::InterfaceRequest<PermissionProvider> request); | |
| 27 ~WebUSBPermissionProvider() override; | |
| 28 | |
| 29 private: | |
| 30 // device::usb::PermissionProvider implementation. | |
| 31 void HasDevicePermission( | |
| 32 mojo::Array<mojo::String> requested_guids, | |
| 33 const HasDevicePermissionCallback& callback) override; | |
| 34 | |
| 35 mojo::StrongBinding<PermissionProvider> binding_; | |
| 36 content::RenderFrameHost* const render_frame_host_; | |
| 37 }; | |
| 38 | |
| 39 } // namespace chrome | |
| 40 | |
| 41 #endif // CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ | |
| OLD | NEW |