| 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 "base/i18n/string_compare.h" | 5 #include "base/i18n/string_compare.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/media/router/media_sink.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 : MediaSink(sink_id, name, icon_type, MediaSink::SinkType::GENERIC) {} |
| 16 |
| 17 MediaSink::MediaSink(const MediaSink::Id& sink_id, |
| 18 const std::string& name, |
| 19 const MediaSink::IconType icon_type, |
| 20 const MediaSink::SinkType sink_type) |
| 21 : type_(sink_type), sink_id_(sink_id), name_(name), icon_type_(icon_type) {} |
| 16 | 22 |
| 17 MediaSink::MediaSink(const MediaSink& other) = default; | 23 MediaSink::MediaSink(const MediaSink& other) = default; |
| 18 | 24 |
| 19 MediaSink::~MediaSink() { | 25 MediaSink::~MediaSink() { |
| 20 } | 26 } |
| 21 | 27 |
| 22 bool MediaSink::Equals(const MediaSink& other) const { | 28 bool MediaSink::Equals(const MediaSink& other) const { |
| 23 return sink_id_ == other.sink_id_; | 29 return sink_id_ == other.sink_id_; |
| 24 } | 30 } |
| 25 | 31 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 40 // available. | 46 // available. |
| 41 int val = name_.compare(other.name_); | 47 int val = name_.compare(other.name_); |
| 42 if (val) | 48 if (val) |
| 43 return val < 0; | 49 return val < 0; |
| 44 } | 50 } |
| 45 | 51 |
| 46 return sink_id_ < other.sink_id_; | 52 return sink_id_ < other.sink_id_; |
| 47 } | 53 } |
| 48 | 54 |
| 49 } // namespace media_router | 55 } // namespace media_router |
| OLD | NEW |