| Index: chrome/common/extensions/dial_device_description_parser_struct_traits.h
|
| diff --git a/chrome/common/extensions/dial_device_description_parser_struct_traits.h b/chrome/common/extensions/dial_device_description_parser_struct_traits.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9e3750b49f5091f3fc30f25c1fa0351239da94a5
|
| --- /dev/null
|
| +++ b/chrome/common/extensions/dial_device_description_parser_struct_traits.h
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_COMMON_EXTENSIONS_DIAL_DEVICE_DESCRIPTION_PARSER_STRUCT_TRAITS_H_
|
| +#define CHROME_COMMON_EXTENSIONS_DIAL_DEVICE_DESCRIPTION_PARSER_STRUCT_TRAITS_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "chrome/common/extensions/dial_device_description_parser.mojom.h"
|
| +#include "chrome/common/media_router/dial_device_description.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +template <>
|
| +struct StructTraits<extensions::mojom::DialDeviceDescriptionDataView,
|
| + media_router::DialDeviceDescription> {
|
| + static const std::string& unique_id(
|
| + const media_router::DialDeviceDescription& description) {
|
| + return description.unique_id;
|
| + }
|
| +
|
| + static const std::string& friendly_name(
|
| + const media_router::DialDeviceDescription& description) {
|
| + return description.friendly_name;
|
| + }
|
| +
|
| + static const std::string& model_name(
|
| + const media_router::DialDeviceDescription& description) {
|
| + return description.model_name;
|
| + }
|
| +
|
| + static const std::string& device_type(
|
| + const media_router::DialDeviceDescription& description) {
|
| + return description.device_type;
|
| + }
|
| +
|
| + static bool Read(extensions::mojom::DialDeviceDescriptionDataView data,
|
| + media_router::DialDeviceDescription* out);
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // CHROME_COMMON_EXTENSIONS_DIAL_DEVICE_DESCRIPTION_PARSER_STRUCT_TRAITS_H_
|
|
|