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

Side by Side Diff: trunk/src/device/hid/hid_report_descriptor_item.cc

Issue 364213005: Revert 281282 "Revert 281133 "chrome.hid: enrich model with repo..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "device/hid/hid_report_descriptor_item.h" 5 #include "device/hid/hid_report_descriptor_item.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "device/hid/hid_usage_and_page.h" 10 #include "device/hid/hid_usage_and_page.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 DCHECK(!IsLong()); 83 DCHECK(!IsLong());
84 return shortData_; 84 return shortData_;
85 } 85 }
86 86
87 HidReportDescriptorItem::CollectionType 87 HidReportDescriptorItem::CollectionType
88 HidReportDescriptorItem::GetCollectionTypeFromValue(uint32_t value) { 88 HidReportDescriptorItem::GetCollectionTypeFromValue(uint32_t value) {
89 switch (value) { 89 switch (value) {
90 case 0x00: 90 case 0x00:
91 return kCollectionTypePhysical; 91 return kCollectionTypePhysical;
92 case 0x01: 92 case 0x01:
93 return kCollectionTypePhysical; 93 return kCollectionTypeApplication;
94 case 0x02: 94 case 0x02:
95 return kCollectionTypePhysical; 95 return kCollectionTypeLogical;
96 case 0x03: 96 case 0x03:
97 return kCollectionTypePhysical; 97 return kCollectionTypeReport;
98 case 0x04: 98 case 0x04:
99 return kCollectionTypePhysical; 99 return kCollectionTypeNamedArray;
100 case 0x05: 100 case 0x05:
101 return kCollectionTypePhysical; 101 return kCollectionTypeUsageSwitch;
102 case 0x06: 102 case 0x06:
103 return kCollectionTypePhysical; 103 return kCollectionTypeUsageModifier;
104 default: 104 default:
105 break; 105 break;
106 } 106 }
107 if (0x80 < value && value < 0xFF) 107 if (0x80 < value && value < 0xFF)
108 return kCollectionTypeVendor; 108 return kCollectionTypeVendor;
109 return kCollectionTypeReserved; 109 return kCollectionTypeReserved;
110 } 110 }
111 111
112 } // namespace device 112 } // namespace device
OLDNEW
« no previous file with comments | « trunk/src/device/hid/hid_report_descriptor.cc ('k') | trunk/src/device/hid/hid_report_descriptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698