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 DEVICE_USB_USB_IDS_H_ | 5 #ifndef DEVICE_USB_USB_IDS_H_ |
6 #define DEVICE_USB_USB_IDS_H_ | 6 #define DEVICE_USB_USB_IDS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 | 12 |
13 namespace device { | 13 namespace device { |
14 | 14 |
15 struct UsbProduct { | 15 struct UsbProduct { |
16 const uint16_t id; | 16 uint16_t id; |
17 const char* name; | 17 const char* name; |
18 }; | 18 }; |
19 | 19 |
20 struct UsbVendor { | 20 struct UsbVendor { |
21 const uint16_t id; | 21 uint16_t id; |
22 const char* name; | 22 const char* name; |
23 const size_t product_size; | 23 size_t product_size; |
24 const UsbProduct* products; | 24 const UsbProduct* products; |
25 }; | 25 }; |
26 | 26 |
27 // UsbIds provides a static mapping from a vendor ID to a name, as well as a | 27 // UsbIds provides a static mapping from a vendor ID to a name, as well as a |
28 // mapping from a vendor/product ID pair to a product name. | 28 // mapping from a vendor/product ID pair to a product name. |
29 class UsbIds { | 29 class UsbIds { |
30 public: | 30 public: |
31 // Gets the name of the vendor who owns |vendor_id|. Returns NULL if the | 31 // Gets the name of the vendor who owns |vendor_id|. Returns NULL if the |
32 // specified |vendor_id| does not exist. | 32 // specified |vendor_id| does not exist. |
33 static const char* GetVendorName(uint16_t vendor_id); | 33 static const char* GetVendorName(uint16_t vendor_id); |
(...skipping 16 matching lines...) Expand all Loading... |
50 // more information on how they are generated. | 50 // more information on how they are generated. |
51 static const size_t vendor_size_; | 51 static const size_t vendor_size_; |
52 static const UsbVendor vendors_[]; | 52 static const UsbVendor vendors_[]; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(UsbIds); | 54 DISALLOW_COPY_AND_ASSIGN(UsbIds); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace device | 57 } // namespace device |
58 | 58 |
59 #endif // DEVICE_USB_USB_IDS_H_ | 59 #endif // DEVICE_USB_USB_IDS_H_ |
OLD | NEW |