Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "extensions/browser/api/serial/serial_api.h" | 5 #include "extensions/browser/api/serial/serial_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace core_api | 429 } // namespace core_api |
| 430 | 430 |
| 431 } // namespace extensions | 431 } // namespace extensions |
| 432 | 432 |
| 433 namespace mojo { | 433 namespace mojo { |
| 434 | 434 |
| 435 // static | 435 // static |
| 436 linked_ptr<extensions::core_api::serial::DeviceInfo> | 436 linked_ptr<extensions::core_api::serial::DeviceInfo> |
| 437 TypeConverter<device::serial::DeviceInfoPtr, | 437 TypeConverter<linked_ptr<extensions::core_api::serial::DeviceInfo>, |
| 438 linked_ptr<extensions::core_api::serial::DeviceInfo> >:: | 438 device::serial::DeviceInfoPtr>> |
| 439 ConvertTo(const device::serial::DeviceInfoPtr& device) { | 439 ::Convert(const device::serial::DeviceInfoPtr& device) { |
|
darin (slow to review)
2014/08/27 03:30:37
It seems like the second template argument might n
Matt Perry
2014/08/27 18:51:31
I think the converters would still need to be in t
| |
| 440 linked_ptr<extensions::core_api::serial::DeviceInfo> info( | 440 linked_ptr<extensions::core_api::serial::DeviceInfo> info( |
| 441 new extensions::core_api::serial::DeviceInfo); | 441 new extensions::core_api::serial::DeviceInfo); |
| 442 info->path = device->path; | 442 info->path = device->path; |
| 443 if (device->has_vendor_id) | 443 if (device->has_vendor_id) |
| 444 info->vendor_id.reset(new int(static_cast<int>(device->vendor_id))); | 444 info->vendor_id.reset(new int(static_cast<int>(device->vendor_id))); |
| 445 if (device->has_product_id) | 445 if (device->has_product_id) |
| 446 info->product_id.reset(new int(static_cast<int>(device->product_id))); | 446 info->product_id.reset(new int(static_cast<int>(device->product_id))); |
| 447 if (device->display_name) | 447 if (device->display_name) |
| 448 info->display_name.reset(new std::string(device->display_name)); | 448 info->display_name.reset(new std::string(device->display_name)); |
| 449 return info; | 449 return info; |
| 450 } | 450 } |
| 451 | 451 |
| 452 } // namespace mojo | 452 } // namespace mojo |
| OLD | NEW |