| OLD | NEW |
| 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 USB_h | 5 #ifndef USB_h |
| 6 #define USB_h | 6 #define USB_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "core/dom/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
| 11 #include "core/events/EventTarget.h" | 11 #include "core/events/EventTarget.h" |
| 12 #include "device/usb/public/interfaces/chooser_service.mojom-wtf.h" | 12 #include "device/usb/public/interfaces/chooser_service.mojom-blink.h" |
| 13 #include "device/usb/public/interfaces/device_manager.mojom-wtf.h" | 13 #include "device/usb/public/interfaces/device_manager.mojom-blink.h" |
| 14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class LocalFrame; | 18 class LocalFrame; |
| 19 class ScopedScriptPromiseResolver; | 19 class ScopedScriptPromiseResolver; |
| 20 class ScriptState; | 20 class ScriptState; |
| 21 class USBDeviceRequestOptions; | 21 class USBDeviceRequestOptions; |
| 22 | 22 |
| 23 class USB final | 23 class USB final |
| (...skipping 15 matching lines...) Expand all Loading... |
| 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(connect); | 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(connect); |
| 40 DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); | 40 DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); |
| 41 | 41 |
| 42 // EventTarget overrides. | 42 // EventTarget overrides. |
| 43 ExecutionContext* getExecutionContext() const override; | 43 ExecutionContext* getExecutionContext() const override; |
| 44 const AtomicString& interfaceName() const override; | 44 const AtomicString& interfaceName() const override; |
| 45 | 45 |
| 46 // ContextLifecycleObserver overrides. | 46 // ContextLifecycleObserver overrides. |
| 47 void contextDestroyed() override; | 47 void contextDestroyed() override; |
| 48 | 48 |
| 49 device::usb::wtf::DeviceManager* deviceManager() const { return m_deviceMana
ger.get(); } | 49 device::usb::blink::DeviceManager* deviceManager() const { return m_deviceMa
nager.get(); } |
| 50 | 50 |
| 51 void onGetDevices(ScriptPromiseResolver*, mojo::WTFArray<device::usb::wtf::D
eviceInfoPtr>); | 51 void onGetDevices(ScriptPromiseResolver*, mojo::WTFArray<device::usb::blink:
:DeviceInfoPtr>); |
| 52 void onGetPermission(ScriptPromiseResolver*, device::usb::wtf::DeviceInfoPtr
); | 52 void onGetPermission(ScriptPromiseResolver*, device::usb::blink::DeviceInfoP
tr); |
| 53 void onDeviceChanges(device::usb::wtf::DeviceChangeNotificationPtr); | 53 void onDeviceChanges(device::usb::blink::DeviceChangeNotificationPtr); |
| 54 | 54 |
| 55 void onDeviceManagerConnectionError(); | 55 void onDeviceManagerConnectionError(); |
| 56 void onChooserServiceConnectionError(); | 56 void onChooserServiceConnectionError(); |
| 57 | 57 |
| 58 DECLARE_VIRTUAL_TRACE(); | 58 DECLARE_VIRTUAL_TRACE(); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 explicit USB(LocalFrame& frame); | 61 explicit USB(LocalFrame& frame); |
| 62 | 62 |
| 63 device::usb::wtf::DeviceManagerPtr m_deviceManager; | 63 device::usb::blink::DeviceManagerPtr m_deviceManager; |
| 64 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests; | 64 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests; |
| 65 device::usb::wtf::ChooserServicePtr m_chooserService; | 65 device::usb::blink::ChooserServicePtr m_chooserService; |
| 66 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests; | 66 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace blink | 69 } // namespace blink |
| 70 | 70 |
| 71 #endif // USB_h | 71 #endif // USB_h |
| OLD | NEW |