Chromium Code Reviews| Index: chrome/browser/usb/web_usb_permission_provider.h |
| diff --git a/chrome/browser/usb/web_usb_permission_provider.h b/chrome/browser/usb/web_usb_permission_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7f4a1490acbab7a785607eac89af540898394b5d |
| --- /dev/null |
| +++ b/chrome/browser/usb/web_usb_permission_provider.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ |
| +#define CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ |
| + |
| +#include "device/devices_app/usb/public/interfaces/permission_provider.mojom.h" |
| +#include "third_party/mojo/src/mojo/public/cpp/bindings/array.h" |
| +#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
| +#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
| + |
| +namespace content { |
| +class RenderFrameHost; |
| +} |
| + |
| +namespace chrome { |
|
Lei Zhang
2015/09/05 00:24:20
no namespace chrome
Reilly Grant (use Gerrit)
2015/09/05 00:56:25
Done.
|
| + |
| +class WebUSBPermissionProvider : public device::usb::PermissionProvider { |
| + public: |
| + 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
|
| + content::RenderFrameHost* render_frame_host, |
| + mojo::InterfaceRequest<device::usb::PermissionProvider> request); |
| + |
| + WebUSBPermissionProvider(content::RenderFrameHost* render_frame_host, |
| + mojo::InterfaceRequest<PermissionProvider> request); |
| + ~WebUSBPermissionProvider() override; |
| + |
| + private: |
| + // device::usb::PermissionProvider implementation. |
| + void HasDevicePermission( |
| + mojo::Array<mojo::String> requested_guids, |
| + const HasDevicePermissionCallback& callback) override; |
| + |
| + mojo::StrongBinding<PermissionProvider> binding_; |
| + content::RenderFrameHost* const render_frame_host_; |
| +}; |
| + |
| +} // namespace chrome |
| + |
| +#endif // CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ |