Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Side by Side Diff: content/renderer/usb/web_usb_client_impl.h

Issue 1850023002: Consume Mojo services directly in Blink's WebUSB implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't do assignments in if statements. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/usb/type_converters.cc ('k') | content/renderer/usb/web_usb_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_
6 #define CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_
7
8 #include "base/macros.h"
9 #include "device/usb/public/interfaces/chooser_service.mojom.h"
10 #include "device/usb/public/interfaces/device_manager.mojom.h"
11 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h"
12
13 namespace content {
14
15 class ServiceRegistry;
16
17 class WebUSBClientImpl : public blink::WebUSBClient {
18 public:
19 explicit WebUSBClientImpl(ServiceRegistry* service_registry);
20 ~WebUSBClientImpl() override;
21
22 private:
23 // blink::WebUSBClient implementation:
24 void getDevices(blink::WebUSBClientGetDevicesCallbacks* callbacks) override;
25 void requestDevice(
26 const blink::WebUSBDeviceRequestOptions& options,
27 blink::WebUSBClientRequestDeviceCallbacks* callbacks) override;
28 void addObserver(Observer* observer) override;
29 void removeObserver(Observer* observer) override;
30
31 device::usb::DeviceManager* GetDeviceManager();
32 void OnDeviceChangeNotification(
33 device::usb::DeviceChangeNotificationPtr notification);
34
35 ServiceRegistry* const service_registry_;
36 device::usb::DeviceManagerPtr device_manager_;
37 device::usb::ChooserServicePtr chooser_service_;
38 std::set<Observer*> observers_;
39
40 DISALLOW_COPY_AND_ASSIGN(WebUSBClientImpl);
41 };
42
43 } // namespace content
44
45 #endif // CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/usb/type_converters.cc ('k') | content/renderer/usb/web_usb_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698