Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/browser/media/router/media_sink.cc

Issue 2675033002: [Media Router] Add MediaSink subtypes (Closed)
Patch Set: add url.mojom to media_router.mojoms JsResources Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 : type_(SinkType::GENERAL),
imcheng 2017/02/08 01:28:08 We can define a protected MediaSink constructor th
zhaobin 2017/02/09 00:13:52 Done.
16 sink_id_(sink_id),
17 name_(name),
18 icon_type_(icon_type) {}
16 19
17 MediaSink::MediaSink(const MediaSink& other) = default; 20 MediaSink::MediaSink(const MediaSink& other) = default;
18 21
19 MediaSink::~MediaSink() { 22 MediaSink::~MediaSink() {
20 } 23 }
21 24
22 bool MediaSink::Equals(const MediaSink& other) const { 25 bool MediaSink::Equals(const MediaSink& other) const {
23 return sink_id_ == other.sink_id_; 26 return sink_id_ == other.sink_id_;
24 } 27 }
25 28
(...skipping 14 matching lines...) Expand all
40 // available. 43 // available.
41 int val = name_.compare(other.name_); 44 int val = name_.compare(other.name_);
42 if (val) 45 if (val)
43 return val < 0; 46 return val < 0;
44 } 47 }
45 48
46 return sink_id_ < other.sink_id_; 49 return sink_id_ < other.sink_id_;
47 } 50 }
48 51
49 } // namespace media_router 52 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698