| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 #include "chrome/browser/media/router/mojo/media_router_struct_traits.h" |
| 6 |
| 7 namespace mojo { |
| 8 |
| 9 // static |
| 10 bool StructTraits<media_router::mojom::IssueDataView, media_router::IssueInfo>:: |
| 11 Read(media_router::mojom::IssueDataView data, |
| 12 media_router::IssueInfo* out) { |
| 13 if (!data.ReadTitle(&out->title)) |
| 14 return false; |
| 15 |
| 16 if (!data.ReadDefaultAction(&out->default_action)) |
| 17 return false; |
| 18 |
| 19 if (!data.ReadSeverity(&out->severity)) |
| 20 return false; |
| 21 |
| 22 base::Optional<std::string> message; |
| 23 if (!data.ReadMessage(&message)) |
| 24 return false; |
| 25 |
| 26 out->message = message.value_or(std::string()); |
| 27 |
| 28 if (!data.ReadSecondaryActions(&out->secondary_actions)) |
| 29 return false; |
| 30 |
| 31 base::Optional<std::string> route_id; |
| 32 if (!data.ReadRouteId(&route_id)) |
| 33 return false; |
| 34 |
| 35 out->route_id = route_id.value_or(std::string()); |
| 36 |
| 37 out->is_blocking = data.is_blocking(); |
| 38 out->help_page_id = data.help_page_id(); |
| 39 |
| 40 return true; |
| 41 } |
| 42 |
| 43 } // namespace mojo |
| OLD | NEW |