Index: third_party/WebKit/Source/modules/webusb/USB.h |
diff --git a/third_party/WebKit/Source/modules/webusb/USB.h b/third_party/WebKit/Source/modules/webusb/USB.h |
index e79cef9cbdfddfd85cc805f26a373b3c9ff47195..ff6ae180563d990b8bbb9a7291b0d6155939f61a 100644 |
--- a/third_party/WebKit/Source/modules/webusb/USB.h |
+++ b/third_party/WebKit/Source/modules/webusb/USB.h |
@@ -9,20 +9,19 @@ |
#include "bindings/core/v8/ScriptWrappable.h" |
#include "core/dom/ContextLifecycleObserver.h" |
#include "core/events/EventTarget.h" |
+#include "device/usb/public/interfaces/chooser_service.mojom-blink.h" |
+#include "device/usb/public/interfaces/device_manager.mojom-blink.h" |
#include "platform/heap/Handle.h" |
-#include "public/platform/modules/webusb/WebUSBClient.h" |
namespace blink { |
class LocalFrame; |
class ScriptState; |
class USBDeviceRequestOptions; |
-class WebUSBDevice; |
class USB final |
: public EventTargetWithInlineData |
- , public ContextLifecycleObserver |
- , public WebUSBClient::Observer { |
+ , public ContextLifecycleObserver { |
DEFINE_WRAPPERTYPEINFO(); |
USING_GARBAGE_COLLECTED_MIXIN(USB); |
USING_PRE_FINALIZER(USB, dispose); |
@@ -32,7 +31,7 @@ public: |
return new USB(frame); |
} |
- ~USB() override; |
+ virtual ~USB(); |
// USB.idl |
ScriptPromise getDevices(ScriptState*); |
@@ -47,9 +46,9 @@ public: |
// ContextLifecycleObserver overrides. |
void contextDestroyed() override; |
- // WebUSBClient::Observer overrides. |
- void onDeviceConnected(std::unique_ptr<WebUSBDevice>) override; |
- void onDeviceDisconnected(std::unique_ptr<WebUSBDevice>) override; |
+ device::usb::blink::DeviceManager* deviceManager() const { return m_deviceManager.get(); } |
+ |
+ void onDeviceChanges(device::usb::blink::DeviceChangeNotificationPtr); |
DECLARE_VIRTUAL_TRACE(); |
@@ -57,7 +56,8 @@ private: |
explicit USB(LocalFrame& frame); |
void dispose(); |
- WebUSBClient* m_client; |
+ device::usb::blink::DeviceManagerPtr m_deviceManager; |
+ device::usb::blink::ChooserServicePtr m_chooserService; |
}; |
} // namespace blink |