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

Side by Side Diff: extensions/browser/api/serial/serial_api.cc

Issue 2492013005: Mojo C++ bindings: switch device/serial mojom target to use STL types. (Closed)
Patch Set: \ Created 4 years, 1 month 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
« no previous file with comments | « device/serial/serial_device_enumerator_win.cc ('k') | tools/battor_agent/battor_finder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 extensions::api::serial::DeviceInfo, 481 extensions::api::serial::DeviceInfo,
482 device::serial::DeviceInfoPtr>::Convert(const device::serial::DeviceInfoPtr& 482 device::serial::DeviceInfoPtr>::Convert(const device::serial::DeviceInfoPtr&
483 device) { 483 device) {
484 extensions::api::serial::DeviceInfo info; 484 extensions::api::serial::DeviceInfo info;
485 info.path = device->path; 485 info.path = device->path;
486 if (device->has_vendor_id) 486 if (device->has_vendor_id)
487 info.vendor_id.reset(new int(static_cast<int>(device->vendor_id))); 487 info.vendor_id.reset(new int(static_cast<int>(device->vendor_id)));
488 if (device->has_product_id) 488 if (device->has_product_id)
489 info.product_id.reset(new int(static_cast<int>(device->product_id))); 489 info.product_id.reset(new int(static_cast<int>(device->product_id)));
490 if (device->display_name) 490 if (device->display_name)
491 info.display_name.reset(new std::string(device->display_name)); 491 info.display_name.reset(new std::string(device->display_name.value()));
492 return info; 492 return info;
493 } 493 }
494 494
495 } // namespace mojo 495 } // namespace mojo
OLDNEW
« no previous file with comments | « device/serial/serial_device_enumerator_win.cc ('k') | tools/battor_agent/battor_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698