| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/usb/usb_api.h" | 5 #include "chrome/browser/extensions/api/usb/usb_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/extensions/api/api_resource_controller.h" | 10 #include "chrome/browser/extensions/api/api_resource_controller.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 UsbCloseDeviceFunction::~UsbCloseDeviceFunction() {} | 67 UsbCloseDeviceFunction::~UsbCloseDeviceFunction() {} |
| 68 | 68 |
| 69 bool UsbCloseDeviceFunction::Prepare() { | 69 bool UsbCloseDeviceFunction::Prepare() { |
| 70 parameters_ = CloseDevice::Params::Create(*args_); | 70 parameters_ = CloseDevice::Params::Create(*args_); |
| 71 EXTENSION_FUNCTION_VALIDATE(parameters_.get()); | 71 EXTENSION_FUNCTION_VALIDATE(parameters_.get()); |
| 72 return true; | 72 return true; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void UsbCloseDeviceFunction::Work() { | 75 void UsbCloseDeviceFunction::Work() { |
| 76 controller()->RemoveAPIResource(parameters_->device.handle); | 76 controller()->RemoveUsbDeviceResource(parameters_->device.handle); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool UsbCloseDeviceFunction::Respond() { | 79 bool UsbCloseDeviceFunction::Respond() { |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 UsbControlTransferFunction::UsbControlTransferFunction() {} | 83 UsbControlTransferFunction::UsbControlTransferFunction() {} |
| 84 | 84 |
| 85 UsbControlTransferFunction::~UsbControlTransferFunction() {} | 85 UsbControlTransferFunction::~UsbControlTransferFunction() {} |
| 86 | 86 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 if (device) { | 140 if (device) { |
| 141 device->InterruptTransfer(parameters_->transfer_info); | 141 device->InterruptTransfer(parameters_->transfer_info); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool UsbInterruptTransferFunction::Respond() { | 145 bool UsbInterruptTransferFunction::Respond() { |
| 146 return true; | 146 return true; |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace extensions | 149 } // namespace extensions |
| OLD | NEW |