OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/containers/small_map.h" | 10 #include "base/containers/small_map.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // |for_display|: Set to true if this route should be displayed for | 37 // |for_display|: Set to true if this route should be displayed for |
38 // |media_sink_id| in UI. | 38 // |media_sink_id| in UI. |
39 MediaRoute(const MediaRoute::Id& media_route_id, | 39 MediaRoute(const MediaRoute::Id& media_route_id, |
40 const MediaSource& media_source, | 40 const MediaSource& media_source, |
41 const MediaSink::Id& media_sink_id, | 41 const MediaSink::Id& media_sink_id, |
42 const std::string& description, | 42 const std::string& description, |
43 bool is_local, | 43 bool is_local, |
44 const std::string& custom_controller_path, | 44 const std::string& custom_controller_path, |
45 bool for_display); | 45 bool for_display); |
46 MediaRoute(const MediaRoute& other); | 46 MediaRoute(const MediaRoute& other); |
| 47 |
| 48 // Used by Mojo. |
| 49 MediaRoute(); |
| 50 |
47 ~MediaRoute(); | 51 ~MediaRoute(); |
48 | 52 |
49 // The media route identifier. | 53 // The media route identifier. |
50 const MediaRoute::Id& media_route_id() const { return media_route_id_; } | 54 const MediaRoute::Id& media_route_id() const { return media_route_id_; } |
51 | 55 |
52 // The media source being routed. | 56 // The media source being routed. |
53 const MediaSource& media_source() const { return media_source_; } | 57 const MediaSource& media_source() const { return media_source_; } |
54 | 58 |
55 // The ID of sink being routed to. | 59 // The ID of sink being routed to. |
56 const MediaSink::Id& media_sink_id() const { return media_sink_id_; } | 60 const MediaSink::Id& media_sink_id() const { return media_sink_id_; } |
(...skipping 24 matching lines...) Expand all Loading... |
81 // Set to |true| if the presentation associated with this route is an | 85 // Set to |true| if the presentation associated with this route is an |
82 // offscreen presentation. | 86 // offscreen presentation. |
83 void set_offscreen_presentation(bool is_offscreen_presentation) { | 87 void set_offscreen_presentation(bool is_offscreen_presentation) { |
84 is_offscreen_presentation_ = is_offscreen_presentation; | 88 is_offscreen_presentation_ = is_offscreen_presentation; |
85 } | 89 } |
86 | 90 |
87 bool is_offscreen_presentation() const { return is_offscreen_presentation_; } | 91 bool is_offscreen_presentation() const { return is_offscreen_presentation_; } |
88 | 92 |
89 bool Equals(const MediaRoute& other) const; | 93 bool Equals(const MediaRoute& other) const; |
90 | 94 |
| 95 // Used by Mojo. |
| 96 void set_media_route_id(const MediaRoute::Id& media_route_id) { |
| 97 media_route_id_ = media_route_id; |
| 98 } |
| 99 void set_media_source(const MediaSource& media_source) { |
| 100 media_source_ = media_source; |
| 101 } |
| 102 void set_media_sink_id(const MediaSink::Id& media_sink_id) { |
| 103 media_sink_id_ = media_sink_id; |
| 104 } |
| 105 void set_description(const std::string& description) { |
| 106 description_ = description; |
| 107 } |
| 108 void set_local(bool is_local) { is_local_ = is_local; } |
| 109 void set_custom_controller_path(const std::string& custom_controller_path) { |
| 110 custom_controller_path_ = custom_controller_path; |
| 111 } |
| 112 void set_for_display(bool for_display) { for_display_ = for_display; } |
| 113 |
91 private: | 114 private: |
92 MediaRoute::Id media_route_id_; | 115 MediaRoute::Id media_route_id_; |
93 MediaSource media_source_; | 116 MediaSource media_source_; |
94 MediaSink::Id media_sink_id_; | 117 MediaSink::Id media_sink_id_; |
95 std::string description_; | 118 std::string description_; |
96 bool is_local_; | 119 bool is_local_ = false; |
97 std::string custom_controller_path_; | 120 std::string custom_controller_path_; |
98 bool for_display_; | 121 bool for_display_ = false; |
99 bool is_incognito_; | 122 bool is_incognito_ = false; |
100 bool is_offscreen_presentation_; | 123 bool is_offscreen_presentation_ = false; |
101 }; | 124 }; |
102 | 125 |
103 } // namespace media_router | 126 } // namespace media_router |
104 | 127 |
105 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 128 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
OLD | NEW |