| 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 "chrome/browser/media/router/media_source.h" | 5 #include "chrome/browser/media/router/media_source.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "url/gurl.h" | |
| 10 | |
| 11 namespace media_router { | 9 namespace media_router { |
| 12 | 10 |
| 13 MediaSource::MediaSource(const MediaSource::Id& source_id) : id_(source_id) { | 11 MediaSource::MediaSource(const MediaSource::Id& source_id) : id_(source_id) { |
| 14 } | 12 } |
| 15 | 13 |
| 16 MediaSource::MediaSource(const GURL& presentation_url) | 14 MediaSource::MediaSource(const GURL& presentation_url) |
| 17 : id_(presentation_url.spec()) {} | 15 : id_(presentation_url.spec()), url_(presentation_url) {} |
| 18 | 16 |
| 19 MediaSource::~MediaSource() {} | 17 MediaSource::~MediaSource() {} |
| 20 | 18 |
| 21 MediaSource::Id MediaSource::id() const { | 19 MediaSource::Id MediaSource::id() const { |
| 22 return id_; | 20 return id_; |
| 23 } | 21 } |
| 24 | 22 |
| 23 GURL MediaSource::url() const { |
| 24 return url_; |
| 25 } |
| 26 |
| 25 bool MediaSource::operator==(const MediaSource& other) const { | 27 bool MediaSource::operator==(const MediaSource& other) const { |
| 26 return id_ == other.id(); | 28 return id_ == other.id(); |
| 27 } | 29 } |
| 28 | 30 |
| 29 std::string MediaSource::ToString() const { | 31 std::string MediaSource::ToString() const { |
| 30 return "MediaSource[" + id_ + "]"; | 32 return "MediaSource[" + id_ + "]"; |
| 31 } | 33 } |
| 32 | 34 |
| 33 } // namespace media_router | 35 } // namespace media_router |
| OLD | NEW |