[Clean up] Fix the comment for SiteIntance::CreateForURL
[chromium-blink-merge.git] / device / hid / hid_device_info.cc
blob987917b731c4a63fe96ec286d8e10a5131743e0b
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
3 // found in the LICENSE file.
5 #include "device/hid/hid_device_info.h"
6 #include "device/hid/hid_report_descriptor.h"
8 namespace device {
10 const char kInvalidHidDeviceId[] = "";
12 HidDeviceInfo::HidDeviceInfo(const HidDeviceId& device_id,
13 uint16_t vendor_id,
14 uint16_t product_id,
15 const std::string& product_name,
16 const std::string& serial_number,
17 HidBusType bus_type,
18 const std::vector<uint8> report_descriptor)
19 : device_id_(device_id),
20 vendor_id_(vendor_id),
21 product_id_(product_id),
22 product_name_(product_name),
23 serial_number_(serial_number),
24 bus_type_(bus_type),
25 report_descriptor_(report_descriptor) {
26 HidReportDescriptor descriptor_parser(report_descriptor_);
27 descriptor_parser.GetDetails(
28 &collections_, &has_report_id_, &max_input_report_size_,
29 &max_output_report_size_, &max_feature_report_size_);
32 HidDeviceInfo::HidDeviceInfo(const HidDeviceId& device_id,
33 uint16_t vendor_id,
34 uint16_t product_id,
35 const std::string& product_name,
36 const std::string& serial_number,
37 HidBusType bus_type,
38 const HidCollectionInfo& collection,
39 size_t max_input_report_size,
40 size_t max_output_report_size,
41 size_t max_feature_report_size)
42 : device_id_(device_id),
43 vendor_id_(vendor_id),
44 product_id_(product_id),
45 product_name_(product_name),
46 serial_number_(serial_number),
47 bus_type_(bus_type),
48 max_input_report_size_(max_input_report_size),
49 max_output_report_size_(max_output_report_size),
50 max_feature_report_size_(max_feature_report_size) {
51 collections_.push_back(collection);
52 has_report_id_ = !collection.report_ids.empty();
55 HidDeviceInfo::~HidDeviceInfo() {}
57 } // namespace device