| 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 MediaRoute(); |
| 48 |
| 47 ~MediaRoute(); | 49 ~MediaRoute(); |
| 48 | 50 |
| 49 // The media route identifier. | 51 void set_media_route_id(const MediaRoute::Id& media_route_id) { |
| 52 media_route_id_ = media_route_id; |
| 53 } |
| 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 void set_media_source(const MediaSource& media_source) { |
| 57 media_source_ = media_source; |
| 58 } |
| 53 const MediaSource& media_source() const { return media_source_; } | 59 const MediaSource& media_source() const { return media_source_; } |
| 54 | 60 |
| 55 // The ID of sink being routed to. | 61 void set_media_sink_id(const MediaSink::Id& media_sink_id) { |
| 62 media_sink_id_ = media_sink_id; |
| 63 } |
| 56 const MediaSink::Id& media_sink_id() const { return media_sink_id_; } | 64 const MediaSink::Id& media_sink_id() const { return media_sink_id_; } |
| 57 | 65 |
| 58 // The description of the media route activity, for example | 66 void set_description(const std::string& description) { |
| 59 // "Playing Foo Bar Music All Access." | 67 description_ = description; |
| 68 } |
| 69 |
| 60 // TODO(kmarshall): Do we need to pass locale for bidi rendering? | 70 // TODO(kmarshall): Do we need to pass locale for bidi rendering? |
| 61 const std::string& description() const { return description_; } | 71 const std::string& description() const { return description_; } |
| 62 | 72 |
| 63 // Returns |true| if the route is created locally (versus discovered | 73 void set_local(bool is_local) { is_local_ = is_local; } |
| 64 // by a media route provider.) | |
| 65 bool is_local() const { return is_local_; } | 74 bool is_local() const { return is_local_; } |
| 66 | 75 |
| 67 // The custom controller path. This allows route provider to have custom route | 76 void set_custom_controller_path(const std::string& custom_controller_path) { |
| 68 // detail as well as its own route control features route control features in | 77 custom_controller_path_ = custom_controller_path; |
| 69 // the media router dialog. | 78 } |
| 70 const std::string& custom_controller_path() const { | 79 const std::string& custom_controller_path() const { |
| 71 return custom_controller_path_; | 80 return custom_controller_path_; |
| 72 } | 81 } |
| 73 | 82 |
| 83 void set_for_display(bool for_display) { for_display_ = for_display; } |
| 74 bool for_display() const { return for_display_; } | 84 bool for_display() const { return for_display_; } |
| 75 | 85 |
| 76 // Set this to true when the route was created by an incognito profile. | |
| 77 void set_incognito(bool is_incognito) { is_incognito_ = is_incognito; } | 86 void set_incognito(bool is_incognito) { is_incognito_ = is_incognito; } |
| 78 | |
| 79 bool is_incognito() const { return is_incognito_; } | 87 bool is_incognito() const { return is_incognito_; } |
| 80 | 88 |
| 81 // Set to |true| if the presentation associated with this route is an | |
| 82 // offscreen presentation. | |
| 83 void set_offscreen_presentation(bool is_offscreen_presentation) { | 89 void set_offscreen_presentation(bool is_offscreen_presentation) { |
| 84 is_offscreen_presentation_ = is_offscreen_presentation; | 90 is_offscreen_presentation_ = is_offscreen_presentation; |
| 85 } | 91 } |
| 86 | |
| 87 bool is_offscreen_presentation() const { return is_offscreen_presentation_; } | 92 bool is_offscreen_presentation() const { return is_offscreen_presentation_; } |
| 88 | 93 |
| 89 bool Equals(const MediaRoute& other) const; | 94 bool Equals(const MediaRoute& other) const; |
| 90 | 95 |
| 91 private: | 96 private: |
| 97 // The media route identifier. |
| 92 MediaRoute::Id media_route_id_; | 98 MediaRoute::Id media_route_id_; |
| 99 |
| 100 // The media source being routed. |
| 93 MediaSource media_source_; | 101 MediaSource media_source_; |
| 102 |
| 103 // The ID of sink being routed to. |
| 94 MediaSink::Id media_sink_id_; | 104 MediaSink::Id media_sink_id_; |
| 105 |
| 106 // The description of the media route activity, for example |
| 107 // "Playing Foo Bar Music All Access." |
| 95 std::string description_; | 108 std::string description_; |
| 96 bool is_local_; | 109 |
| 110 // |true| if the route is created locally (versus discovered by a media route |
| 111 // provider.) |
| 112 bool is_local_ = false; |
| 113 |
| 114 // The custom controller path. This allows route provider to have custom route |
| 115 // detail as well as its own route control features route control features in |
| 116 // the media router dialog. |
| 97 std::string custom_controller_path_; | 117 std::string custom_controller_path_; |
| 98 bool for_display_; | 118 |
| 99 bool is_incognito_; | 119 // |true| if the route can be displayed in the UI. |
| 100 bool is_offscreen_presentation_; | 120 bool for_display_ = false; |
| 121 |
| 122 // |true| if the route was created by an incognito profile. |
| 123 bool is_incognito_ = false; |
| 124 |
| 125 // |true| if the presentation associated with this route is an offscreen |
| 126 // presentation. |
| 127 bool is_offscreen_presentation_ = false; |
| 101 }; | 128 }; |
| 102 | 129 |
| 103 } // namespace media_router | 130 } // namespace media_router |
| 104 | 131 |
| 105 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 132 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
| OLD | NEW |