| Index: device/usb/usb_service_android.h
|
| diff --git a/device/usb/usb_service_android.h b/device/usb/usb_service_android.h
|
| index 9cab43851716cbccbd4b31b58cf8896492ad0d89..cfa0e45a2e2f76349822ac6bb0d1c650b573909b 100644
|
| --- a/device/usb/usb_service_android.h
|
| +++ b/device/usb/usb_service_android.h
|
| @@ -6,12 +6,15 @@
|
| #define DEVICE_USB_USB_SERVICE_ANDROID_H_
|
|
|
| #include <string>
|
| +#include <unordered_map>
|
|
|
| #include "base/android/scoped_java_ref.h"
|
| #include "device/usb/usb_service.h"
|
|
|
| namespace device {
|
|
|
| +class UsbDeviceAndroid;
|
| +
|
| // USB service implementation for Android. This is a stub implementation that
|
| // does not return any devices.
|
| class UsbServiceAndroid : public UsbService {
|
| @@ -26,7 +29,21 @@ class UsbServiceAndroid : public UsbService {
|
| scoped_refptr<UsbDevice> GetDevice(const std::string& guid) override;
|
| void GetDevices(const GetDevicesCallback& callback) override;
|
|
|
| + // Methods called by Java.
|
| + void DeviceAttached(JNIEnv* env,
|
| + const base::android::JavaRef<jobject>& caller,
|
| + const base::android::JavaRef<jobject>& usb_device);
|
| + void DeviceDetached(JNIEnv* env,
|
| + const base::android::JavaRef<jobject>& caller,
|
| + jint device_id);
|
| +
|
| private:
|
| + void AddDevice(scoped_refptr<UsbDeviceAndroid> device);
|
| +
|
| + std::unordered_map<jint, scoped_refptr<UsbDeviceAndroid>> devices_by_id_;
|
| + std::unordered_map<std::string, scoped_refptr<UsbDeviceAndroid>>
|
| + devices_by_guid_;
|
| +
|
| // Java object org.chromium.device.usb.ChromeUsbService.
|
| base::android::ScopedJavaGlobalRef<jobject> j_object_;
|
| };
|
|
|