| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "device/usb/usb_device_impl.h" | 5 #include "device/usb/usb_device_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
| 16 #include "device/usb/usb_context.h" | 16 #include "device/usb/usb_context.h" |
| 17 #include "device/usb/usb_descriptors.h" | 17 #include "device/usb/usb_descriptors.h" |
| 18 #include "device/usb/usb_device_handle_impl.h" | 18 #include "device/usb/usb_device_handle_impl.h" |
| 19 #include "device/usb/usb_error.h" | 19 #include "device/usb/usb_error.h" |
| 20 #include "third_party/libusb/src/libusb/libusb.h" | 20 #include "third_party/libusb/src/libusb/libusb.h" |
| 21 | 21 |
| 22 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 23 #include "base/sys_info.h" | 23 #include "base/sys_info.h" |
| 24 #include "chromeos/dbus/dbus_thread_manager.h" | 24 #include "chromeos/dbus/dbus_thread_manager.h" |
| 25 #include "chromeos/dbus/permission_broker_client.h" | 25 #include "chromeos/dbus/permission_broker_client.h" |
| 26 #endif // defined(OS_CHROMEOS) | 26 #endif // defined(OS_CHROMEOS) |
| 27 | 27 |
| 28 #if defined(USE_UDEV) | 28 #if defined(USE_UDEV) |
| 29 #include "device/udev_linux/udev.h" | 29 #include "device/udev_linux/scoped_udev.h" |
| 30 #endif // defined(USE_UDEV) | 30 #endif // defined(USE_UDEV) |
| 31 | 31 |
| 32 namespace device { | 32 namespace device { |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| 37 void OnRequestUsbAccessReplied( | 37 void OnRequestUsbAccessReplied( |
| 38 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 38 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 39 const base::Callback<void(bool success)>& callback, | 39 const base::Callback<void(bool success)>& callback, |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 } else { | 400 } else { |
| 401 VLOG(1) << "Failed to read device descriptor to cache string descriptors: " | 401 VLOG(1) << "Failed to read device descriptor to cache string descriptors: " |
| 402 << ConvertPlatformUsbErrorToString(rv); | 402 << ConvertPlatformUsbErrorToString(rv); |
| 403 } | 403 } |
| 404 strings_cached_ = true; | 404 strings_cached_ = true; |
| 405 } | 405 } |
| 406 #endif // !defined(USE_UDEV) | 406 #endif // !defined(USE_UDEV) |
| 407 | 407 |
| 408 } // namespace device | 408 } // namespace device |
| OLD | NEW |