Move string descriptor getters from UsbDeviceHandle to UsbDevice.
commit43c5c906400e24aa59382d47a8654c35c2cb9cc6
authorreillyg <reillyg@chromium.org>
Thu, 25 Sep 2014 22:02:48 +0000 (25 15:02 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 25 Sep 2014 22:02:59 +0000 (25 22:02 +0000)
tree02b7cd45c0427ef2b005a31ef747c3d5fc415d89
parentd0956cf3b7e8662b94e3ef26b4d685ddc6702a0a
Move string descriptor getters from UsbDeviceHandle to UsbDevice.

The common string descriptors: iManufacturer, iProduct and iSerialNumber
should be accessible without opening the device. On Linux these can be
read out of sysfs without having access to the usbfs device node. This
is critical on Chrome OS because otherwise the permission broker needs
to be asked for permission to access the device. On other platforms we
fall back to opening the device temporarily. This will stop being the
case on OS X when libusb is no longer used and on Windows this will be
part of the initial enumeration process.

BUG=
TBR=dgozman@chromium.org

Review URL: https://codereview.chromium.org/601073002

Cr-Commit-Position: refs/heads/master@{#296802}
17 files changed:
apps/saved_devices_service.cc
apps/saved_devices_service_unittest.cc
chrome/browser/devtools/device/usb/android_usb_browsertest.cc
chrome/browser/devtools/device/usb/android_usb_device.cc
device/hid/hid_connection_unittest.cc
device/test/usb_test_gadget.h
device/test/usb_test_gadget_impl.cc
device/usb/usb_device.h
device/usb/usb_device_filter_unittest.cc
device/usb/usb_device_handle.h
device/usb/usb_device_handle_impl.cc
device/usb/usb_device_handle_impl.h
device/usb/usb_device_impl.cc
device/usb/usb_device_impl.h
device/usb/usb_service_unittest.cc
extensions/browser/api/usb/usb_apitest.cc
extensions/browser/api/usb_private/usb_private_api.cc