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 #include "third_party/icu/source/common/unicode/uversion.h" | 10 #include "third_party/icu/source/common/unicode/uversion.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 bool CompareUsingCollator(const MediaSink& other, | 56 bool CompareUsingCollator(const MediaSink& other, |
57 const icu::Collator* collator) const; | 57 const icu::Collator* collator) const; |
58 | 58 |
59 // For storing in sets and in maps as keys. | 59 // For storing in sets and in maps as keys. |
60 struct Compare { | 60 struct Compare { |
61 bool operator()(const MediaSink& sink1, const MediaSink& sink2) const { | 61 bool operator()(const MediaSink& sink1, const MediaSink& sink2) const { |
62 return sink1.id() < sink2.id(); | 62 return sink1.id() < sink2.id(); |
63 } | 63 } |
64 }; | 64 }; |
65 | 65 |
| 66 // Used by Mojo. |
| 67 MediaSink(); |
| 68 void set_sink_id(const MediaSink::Id& sink_id) { sink_id_ = sink_id; } |
| 69 void set_name(const std::string& name) { name_ = name; } |
| 70 void set_icon_type(IconType icon_type) { icon_type_ = icon_type; } |
| 71 |
66 private: | 72 private: |
67 // Unique identifier for the MediaSink. | 73 // Unique identifier for the MediaSink. |
68 MediaSink::Id sink_id_; | 74 MediaSink::Id sink_id_; |
69 | 75 |
70 // Descriptive name of the MediaSink. | 76 // Descriptive name of the MediaSink. |
71 std::string name_; | 77 std::string name_; |
72 | 78 |
73 // Optional description of the MediaSink. | 79 // Optional description of the MediaSink. |
74 std::string description_; | 80 std::string description_; |
75 | 81 |
76 // Optional domain of the MediaSink. | 82 // Optional domain of the MediaSink. |
77 std::string domain_; | 83 std::string domain_; |
78 | 84 |
79 // The type of icon that corresponds with the MediaSink. | 85 // The type of icon that corresponds with the MediaSink. |
80 IconType icon_type_; | 86 IconType icon_type_ = IconType::GENERIC; |
81 }; | 87 }; |
82 | 88 |
83 } // namespace media_router | 89 } // namespace media_router |
84 | 90 |
85 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ | 91 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
OLD | NEW |