OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/media/router/mojo/media_router_struct_traits.h" | 5 #include "chrome/browser/media/router/mojo/media_router_struct_traits.h" |
6 | 6 |
7 #include "chrome/browser/media/router/media_source.h" | 7 #include "chrome/browser/media/router/media_source.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 out->set_custom_controller_path(*custom_controller_path); | 120 out->set_custom_controller_path(*custom_controller_path); |
121 | 121 |
122 out->set_local(data.is_local()); | 122 out->set_local(data.is_local()); |
123 out->set_for_display(data.for_display()); | 123 out->set_for_display(data.for_display()); |
124 out->set_incognito(data.is_incognito()); | 124 out->set_incognito(data.is_incognito()); |
125 out->set_offscreen_presentation(data.is_offscreen_presentation()); | 125 out->set_offscreen_presentation(data.is_offscreen_presentation()); |
126 | 126 |
127 return true; | 127 return true; |
128 } | 128 } |
129 | 129 |
130 // static | |
131 bool StructTraits<media_router::mojom::MediaStatusDataView, | |
132 media_router::MediaStatus>:: | |
133 Read(media_router::mojom::MediaStatusDataView data, | |
134 media_router::MediaStatus* out) { | |
135 std::string title; | |
136 if (!data.ReadTitle(&title)) | |
mark a. foltz
2017/03/06 20:06:20
Check that title and status are valid UTF-8.
dcheng
2017/03/08 01:08:20
Just read it directly into out->title, rather than
takumif
2017/03/08 04:24:03
Done.
takumif
2017/03/08 04:24:03
Done.
| |
137 return false; | |
138 out->title = title; | |
139 | |
140 std::string status; | |
141 if (!data.ReadStatus(&status)) | |
142 return false; | |
143 out->status = status; | |
144 | |
145 out->can_play_pause = data.can_play_pause(); | |
146 out->can_mute = data.can_mute(); | |
147 out->can_set_volume = data.can_set_volume(); | |
148 out->can_seek = data.can_seek(); | |
149 out->is_paused = data.is_paused(); | |
150 out->is_muted = data.is_muted(); | |
151 out->volume = data.volume(); | |
152 out->duration = data.duration(); | |
153 out->current_time = data.current_time(); | |
154 | |
155 return true; | |
156 } | |
157 | |
130 } // namespace mojo | 158 } // namespace mojo |
OLD | NEW |