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

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

Issue 507173003: Change TypeConverter<X,Y>::ConvertFrom and ConvertTo into a single symmetric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile for real Created 6 years, 3 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
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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 results_ = serial::SetControlSignals::Results::Create(success); 426 results_ = serial::SetControlSignals::Results::Create(success);
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> TypeConverter<
437 TypeConverter<device::serial::DeviceInfoPtr, 437 linked_ptr<extensions::core_api::serial::DeviceInfo>,
438 linked_ptr<extensions::core_api::serial::DeviceInfo> >:: 438 device::serial::DeviceInfoPtr>::Convert(const device::serial::DeviceInfoPtr&
439 ConvertTo(const device::serial::DeviceInfoPtr& device) { 439 device) {
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
OLDNEW
« no previous file with comments | « extensions/browser/api/serial/serial_api.h ('k') | extensions/browser/api/serial/serial_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698