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 #include "components/media_router/media_sink.h" |
5 #include "base/i18n/string_compare.h" | 6 #include "base/i18n/string_compare.h" |
6 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/media/router/media_sink.h" | |
8 #include "third_party/icu/source/i18n/unicode/coll.h" | 8 #include "third_party/icu/source/i18n/unicode/coll.h" |
9 | 9 |
10 namespace media_router { | 10 namespace media_router { |
11 | 11 |
12 MediaSink::MediaSink(const MediaSink::Id& sink_id, | 12 MediaSink::MediaSink(const MediaSink::Id& sink_id, |
13 const std::string& name, | 13 const std::string& name, |
14 const MediaSink::IconType icon_type) | 14 const MediaSink::IconType icon_type) |
15 : sink_id_(sink_id), name_(name), icon_type_(icon_type) {} | 15 : sink_id_(sink_id), name_(name), icon_type_(icon_type) {} |
16 | 16 |
17 MediaSink::MediaSink(const MediaSink& other) = default; | 17 MediaSink::MediaSink(const MediaSink& other) = default; |
18 | 18 |
19 MediaSink::MediaSink() {} | 19 MediaSink::MediaSink() {} |
20 | 20 |
21 MediaSink::~MediaSink() { | 21 MediaSink::~MediaSink() {} |
22 } | |
23 | 22 |
24 bool MediaSink::Equals(const MediaSink& other) const { | 23 bool MediaSink::Equals(const MediaSink& other) const { |
25 return sink_id_ == other.sink_id_; | 24 return sink_id_ == other.sink_id_; |
26 } | 25 } |
27 | 26 |
28 bool MediaSink::operator==(const MediaSink& other) const { | 27 bool MediaSink::operator==(const MediaSink& other) const { |
29 return sink_id_ == other.sink_id_ && name_ == other.name_ && | 28 return sink_id_ == other.sink_id_ && name_ == other.name_ && |
30 description_ == other.description_ && domain_ == other.domain_ && | 29 description_ == other.description_ && domain_ == other.domain_ && |
31 icon_type_ == other.icon_type_; | 30 icon_type_ == other.icon_type_; |
32 } | 31 } |
(...skipping 19 matching lines...) Expand all Loading... |
52 // available. | 51 // available. |
53 int val = name_.compare(other.name_); | 52 int val = name_.compare(other.name_); |
54 if (val) | 53 if (val) |
55 return val < 0; | 54 return val < 0; |
56 } | 55 } |
57 | 56 |
58 return sink_id_ < other.sink_id_; | 57 return sink_id_ < other.sink_id_; |
59 } | 58 } |
60 | 59 |
61 } // namespace media_router | 60 } // namespace media_router |
OLD | NEW |