Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: chrome/browser/extensions/api/usb/usb_api.h

Issue 236203019: Move UsbService to its own component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move usb_service component symbols into usb_service namespace Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/usb/DEPS ('k') | chrome/browser/extensions/api/usb/usb_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/usb/usb_api.h
diff --git a/chrome/browser/extensions/api/usb/usb_api.h b/chrome/browser/extensions/api/usb/usb_api.h
index 9262eca6963ac59a7cef4f44d3d8b70258a490d7..12e572cbac4053abec2bb7e88597cdcaa726161c 100644
--- a/chrome/browser/extensions/api/usb/usb_api.h
+++ b/chrome/browser/extensions/api/usb/usb_api.h
@@ -10,17 +10,13 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/usb/usb_device.h"
-#include "chrome/browser/usb/usb_device_handle.h"
#include "chrome/common/extensions/api/usb.h"
+#include "components/usb_service/usb_device.h"
+#include "components/usb_service/usb_device_handle.h"
#include "extensions/browser/api/api_resource_manager.h"
#include "extensions/browser/api/async_api_function.h"
#include "net/base/io_buffer.h"
-class UsbDevice;
-class UsbDeviceHandle;
-class UsbService;
-
namespace extensions {
class UsbDeviceResource;
@@ -35,11 +31,12 @@ class UsbAsyncApiFunction : public AsyncApiFunction {
virtual bool PrePrepare() OVERRIDE;
virtual bool Respond() OVERRIDE;
- scoped_refptr<UsbDevice> GetDeviceOrOrCompleteWithError(
+ scoped_refptr<usb_service::UsbDevice> GetDeviceOrOrCompleteWithError(
const extensions::api::usb::Device& input_device);
- scoped_refptr<UsbDeviceHandle> GetDeviceHandleOrCompleteWithError(
- const extensions::api::usb::ConnectionHandle& input_device_handle);
+ scoped_refptr<usb_service::UsbDeviceHandle>
+ GetDeviceHandleOrCompleteWithError(
+ const extensions::api::usb::ConnectionHandle& input_device_handle);
void RemoveUsbDeviceResource(int api_resource_id);
@@ -54,13 +51,15 @@ class UsbAsyncApiTransferFunction : public UsbAsyncApiFunction {
virtual ~UsbAsyncApiTransferFunction();
bool ConvertDirectionSafely(const extensions::api::usb::Direction& input,
- UsbEndpointDirection* output);
- bool ConvertRequestTypeSafely(const extensions::api::usb::RequestType& input,
- UsbDeviceHandle::TransferRequestType* output);
- bool ConvertRecipientSafely(const extensions::api::usb::Recipient& input,
- UsbDeviceHandle::TransferRecipient* output);
-
- void OnCompleted(UsbTransferStatus status,
+ usb_service::UsbEndpointDirection* output);
+ bool ConvertRequestTypeSafely(
+ const extensions::api::usb::RequestType& input,
+ usb_service::UsbDeviceHandle::TransferRequestType* output);
+ bool ConvertRecipientSafely(
+ const extensions::api::usb::Recipient& input,
+ usb_service::UsbDeviceHandle::TransferRecipient* output);
+
+ void OnCompleted(usb_service::UsbTransferStatus status,
scoped_refptr<net::IOBuffer> data,
size_t length);
};
@@ -78,9 +77,10 @@ class UsbFindDevicesFunction : public UsbAsyncApiFunction {
virtual void AsyncWorkStart() OVERRIDE;
private:
- void OpenDevices(scoped_ptr<std::vector<scoped_refptr<UsbDevice> > > devices);
+ void OpenDevices(
+ scoped_ptr<std::vector<scoped_refptr<usb_service::UsbDevice> > > devices);
- std::vector<scoped_refptr<UsbDeviceHandle> > device_handles_;
+ std::vector<scoped_refptr<usb_service::UsbDeviceHandle> > device_handles_;
scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_;
};
@@ -90,7 +90,7 @@ class UsbGetDevicesFunction : public UsbAsyncApiFunction {
UsbGetDevicesFunction();
- static void SetDeviceForTest(UsbDevice* device);
+ static void SetDeviceForTest(usb_service::UsbDevice* device);
virtual bool Prepare() OVERRIDE;
virtual void AsyncWorkStart() OVERRIDE;
@@ -100,7 +100,7 @@ class UsbGetDevicesFunction : public UsbAsyncApiFunction {
private:
void EnumerationCompletedFileThread(
- scoped_ptr<std::vector<scoped_refptr<UsbDevice> > > devices);
+ scoped_ptr<std::vector<scoped_refptr<usb_service::UsbDevice> > > devices);
scoped_ptr<extensions::api::usb::GetDevices::Params> parameters_;
};
@@ -136,7 +136,7 @@ class UsbOpenDeviceFunction : public UsbAsyncApiFunction {
virtual ~UsbOpenDeviceFunction();
private:
- scoped_refptr<UsbDeviceHandle> handle_;
+ scoped_refptr<usb_service::UsbDeviceHandle> handle_;
scoped_ptr<extensions::api::usb::OpenDevice::Params> parameters_;
};
@@ -153,14 +153,14 @@ class UsbListInterfacesFunction : public UsbAsyncApiFunction {
virtual void AsyncWorkStart() OVERRIDE;
private:
- bool ConvertDirectionSafely(const UsbEndpointDirection& input,
+ bool ConvertDirectionSafely(const usb_service::UsbEndpointDirection& input,
extensions::api::usb::Direction* output);
bool ConvertSynchronizationTypeSafely(
- const UsbSynchronizationType& input,
+ const usb_service::UsbSynchronizationType& input,
extensions::api::usb::SynchronizationType* output);
- bool ConvertTransferTypeSafely(const UsbTransferType& input,
+ bool ConvertTransferTypeSafely(const usb_service::UsbTransferType& input,
extensions::api::usb::TransferType* output);
- bool ConvertUsageTypeSafely(const UsbUsageType& input,
+ bool ConvertUsageTypeSafely(const usb_service::UsbUsageType& input,
extensions::api::usb::UsageType* output);
scoped_ptr<base::ListValue> result_;
« no previous file with comments | « chrome/browser/extensions/api/usb/DEPS ('k') | chrome/browser/extensions/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698