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

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

Issue 1371793004: Provide the DeviceManager service to the renderer directly, no app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface_permission
Patch Set: Fix chrome_browser.gypi. Created 5 years, 2 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/render_frame_impl.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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ 5 #ifndef CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_
6 #define CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ 6 #define CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_
7 7
8 #include "base/id_map.h"
9 #include "base/macros.h" 8 #include "base/macros.h"
10 #include "device/devices_app/usb/public/interfaces/device_manager.mojom.h" 9 #include "device/devices_app/usb/public/interfaces/device_manager.mojom.h"
11 #include "mojo/application/public/interfaces/service_provider.mojom.h"
12 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h" 10 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h"
13 11
14 namespace content { 12 namespace content {
15 13
14 class ServiceRegistry;
15
16 class WebUSBClientImpl : public blink::WebUSBClient { 16 class WebUSBClientImpl : public blink::WebUSBClient {
17 public: 17 public:
18 explicit WebUSBClientImpl(mojo::ServiceProviderPtr device_services); 18 explicit WebUSBClientImpl(content::ServiceRegistry* service_registry);
19 ~WebUSBClientImpl() override; 19 ~WebUSBClientImpl() override;
20 20
21 private: 21 private:
22 // blink::WebUSBClient implementation: 22 // blink::WebUSBClient implementation:
23 void getDevices(blink::WebUSBClientGetDevicesCallbacks* callbacks) override; 23 void getDevices(blink::WebUSBClientGetDevicesCallbacks* callbacks) override;
24 void requestDevice( 24 void requestDevice(
25 const blink::WebUSBDeviceRequestOptions& options, 25 const blink::WebUSBDeviceRequestOptions& options,
26 blink::WebUSBClientRequestDeviceCallbacks* callbacks) override; 26 blink::WebUSBClientRequestDeviceCallbacks* callbacks) override;
27 void setObserver(Observer* observer) override; 27 void setObserver(Observer* observer) override;
28 28
29 void OnDeviceChangeNotification( 29 void OnDeviceChangeNotification(
30 device::usb::DeviceChangeNotificationPtr notification); 30 device::usb::DeviceChangeNotificationPtr notification);
31 31
32 mojo::ServiceProviderPtr device_services_;
33 device::usb::DeviceManagerPtr device_manager_; 32 device::usb::DeviceManagerPtr device_manager_;
34 Observer* observer_ = nullptr; 33 Observer* observer_ = nullptr;
35 34
36 DISALLOW_COPY_AND_ASSIGN(WebUSBClientImpl); 35 DISALLOW_COPY_AND_ASSIGN(WebUSBClientImpl);
37 }; 36 };
38 37
39 } // namespace content 38 } // namespace content
40 39
41 #endif // CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ 40 #endif // CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.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