| 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_SINK_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace media_router { | 10 namespace media_router { |
| 11 | 11 |
| 12 // Represents a sink to which media can be routed. | 12 // Represents a sink to which media can be routed. |
| 13 class MediaSink { | 13 class MediaSink { |
| 14 public: | 14 public: |
| 15 using Id = std::string; | 15 using Id = std::string; |
| 16 | 16 |
| 17 enum IconType { | 17 enum IconType { |
| 18 CAST, | 18 CAST, |
| 19 CAST_AUDIO, | 19 CAST_AUDIO, |
| 20 GENERIC, | 20 GENERIC, |
| 21 HANGOUT | 21 HANGOUT |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 MediaSink(const MediaSink::Id& sink_id, | 24 MediaSink(const MediaSink::Id& sink_id, |
| 25 const std::string& name, | 25 const std::string& name, |
| 26 const IconType icon_type); | 26 const IconType icon_type); |
| 27 | 27 |
| 28 MediaSink(const MediaSink::Id& sink_id, | |
| 29 const std::string& name, | |
| 30 const IconType icon_type, | |
| 31 bool is_launching); | |
| 32 | |
| 33 ~MediaSink(); | 28 ~MediaSink(); |
| 34 | 29 |
| 35 const MediaSink::Id& id() const { return sink_id_; } | 30 const MediaSink::Id& id() const { return sink_id_; } |
| 36 const std::string& name() const { return name_; } | 31 const std::string& name() const { return name_; } |
| 37 MediaSink::IconType icon_type() const { return icon_type_; } | 32 MediaSink::IconType icon_type() const { return icon_type_; } |
| 38 bool is_launching() const { return is_launching_; } | |
| 39 | 33 |
| 40 bool Equals(const MediaSink& other) const; | 34 bool Equals(const MediaSink& other) const; |
| 41 bool Empty() const; | 35 bool Empty() const; |
| 42 | 36 |
| 43 private: | 37 private: |
| 44 // Unique identifier for the MediaSink. | 38 // Unique identifier for the MediaSink. |
| 45 MediaSink::Id sink_id_; | 39 MediaSink::Id sink_id_; |
| 46 // Descriptive name of the MediaSink. | 40 // Descriptive name of the MediaSink. |
| 47 // Optional, can use an empty string if no sink name is available. | 41 // Optional, can use an empty string if no sink name is available. |
| 48 std::string name_; | 42 std::string name_; |
| 49 // The type of icon that corresponds with the MediaSink. | 43 // The type of icon that corresponds with the MediaSink. |
| 50 MediaSink::IconType icon_type_; | 44 MediaSink::IconType icon_type_; |
| 51 // True when the media router is creating a route to this sink. | |
| 52 bool is_launching_; | |
| 53 }; | 45 }; |
| 54 | 46 |
| 55 } // namespace media_router | 47 } // namespace media_router |
| 56 | 48 |
| 57 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ | 49 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
| OLD | NEW |