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 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "chrome/browser/extensions/api/api_resource.h" | 14 #include "chrome/browser/extensions/api/api_resource.h" |
15 #include "chrome/browser/usb/usb_device.h" | 15 #include "chrome/browser/usb/usb_device.h" |
16 #include "chrome/common/extensions/api/usb.h" | 16 #include "chrome/common/extensions/api/usb.h" |
17 | 17 |
18 class UsbDevice; | 18 class UsbDevice; |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 class IOBuffer; | 21 class IOBuffer; |
22 } // namespace net | 22 } // namespace net |
23 | 23 |
24 namespace extensions { | 24 namespace extensions { |
25 | 25 |
26 class ApiResourceEventNotifier; | |
27 | |
28 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice. | 26 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice. |
29 class UsbDeviceResource : public ApiResource { | 27 class UsbDeviceResource : public ApiResource { |
30 public: | 28 public: |
31 UsbDeviceResource(const std::string& owner_extension_id, | 29 UsbDeviceResource(const std::string& owner_extension_id, |
32 ApiResourceEventNotifier* notifier, | |
33 scoped_refptr<UsbDevice> device); | 30 scoped_refptr<UsbDevice> device); |
34 virtual ~UsbDeviceResource(); | 31 virtual ~UsbDeviceResource(); |
35 | 32 |
36 scoped_refptr<UsbDevice> device() { | 33 scoped_refptr<UsbDevice> device() { |
37 return device_; | 34 return device_; |
38 } | 35 } |
39 | 36 |
40 private: | 37 private: |
41 scoped_refptr<UsbDevice> device_; | 38 scoped_refptr<UsbDevice> device_; |
42 | 39 |
43 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource); | 40 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource); |
44 }; | 41 }; |
45 | 42 |
46 } // namespace extensions | 43 } // namespace extensions |
47 | 44 |
48 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ | 45 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ |
OLD | NEW |