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 #include "content/renderer/usb/web_usb_device_impl.h" | 5 #include "content/renderer/usb/web_usb_device_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "content/child/mojo/type_converters.h" | 12 #include "content/child/mojo/type_converters.h" |
13 #include "content/child/scoped_web_callbacks.h" | 13 #include "content/child/scoped_web_callbacks.h" |
14 #include "content/renderer/usb/type_converters.h" | 14 #include "content/renderer/usb/type_converters.h" |
15 #include "mojo/shell/public/cpp/connect.h" | 15 #include "mojo/shell/public/cpp/connect.h" |
16 #include "mojo/shell/public/interfaces/shell.mojom.h" | 16 #include "mojo/shell/public/interfaces/connector.mojom.h" |
17 #include "third_party/WebKit/public/platform/WebVector.h" | 17 #include "third_party/WebKit/public/platform/WebVector.h" |
18 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceInfo.h" | 18 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceInfo.h" |
19 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBTransferInfo.h
" | 19 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBTransferInfo.h
" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 const char kClaimInterfaceFailed[] = "Unable to claim interface."; | 25 const char kClaimInterfaceFailed[] = "Unable to claim interface."; |
26 const char kClearHaltFailed[] = "Unable to clear endpoint."; | 26 const char kClearHaltFailed[] = "Unable to clear endpoint."; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 430 |
431 void WebUSBDeviceImpl::reset(blink::WebUSBDeviceResetCallbacks* callbacks) { | 431 void WebUSBDeviceImpl::reset(blink::WebUSBDeviceResetCallbacks* callbacks) { |
432 auto scoped_callbacks = MakeScopedUSBCallbacks(callbacks); | 432 auto scoped_callbacks = MakeScopedUSBCallbacks(callbacks); |
433 if (device_) | 433 if (device_) |
434 device_->Reset(base::Bind(&HandlePassFailDeviceOperation, | 434 device_->Reset(base::Bind(&HandlePassFailDeviceOperation, |
435 base::Passed(&scoped_callbacks), | 435 base::Passed(&scoped_callbacks), |
436 kDeviceResetFailed)); | 436 kDeviceResetFailed)); |
437 } | 437 } |
438 | 438 |
439 } // namespace content | 439 } // namespace content |
OLD | NEW |