| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_DIAL_DEVICE_DESCRIPTION_PARSER_STRUCT_TRAITS_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_DIAL_DEVICE_DESCRIPTION_PARSER_STRUCT_TRAITS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/common/extensions/dial_device_description_parser.mojom.h" |
| 11 #include "chrome/common/media_router/dial_device_description.h" |
| 12 |
| 13 namespace mojo { |
| 14 |
| 15 template <> |
| 16 struct StructTraits<extensions::mojom::DialDeviceDescriptionDataView, |
| 17 media_router::DialDeviceDescription> { |
| 18 static const std::string& unique_id( |
| 19 const media_router::DialDeviceDescription& description) { |
| 20 return description.unique_id; |
| 21 } |
| 22 |
| 23 static const std::string& friendly_name( |
| 24 const media_router::DialDeviceDescription& description) { |
| 25 return description.friendly_name; |
| 26 } |
| 27 |
| 28 static const std::string& model_name( |
| 29 const media_router::DialDeviceDescription& description) { |
| 30 return description.model_name; |
| 31 } |
| 32 |
| 33 static const std::string& device_type( |
| 34 const media_router::DialDeviceDescription& description) { |
| 35 return description.device_type; |
| 36 } |
| 37 |
| 38 static bool Read(extensions::mojom::DialDeviceDescriptionDataView data, |
| 39 media_router::DialDeviceDescription* out); |
| 40 }; |
| 41 |
| 42 } // namespace mojo |
| 43 |
| 44 #endif // CHROME_COMMON_EXTENSIONS_DIAL_DEVICE_DESCRIPTION_PARSER_STRUCT_TRAITS
_H_ |
| OLD | NEW |