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

Unified Diff: chrome/browser/media/router/cast_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/cast_media_sink.cc
diff --git a/chrome/browser/media/router/cast_media_sink.cc b/chrome/browser/media/router/cast_media_sink.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4c192f3d43650e819e419fc0ab265ec6f57d4b0e
--- /dev/null
+++ b/chrome/browser/media/router/cast_media_sink.cc
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/media/router/cast_media_sink.h"
+
+#include "base/logging.h"
+
+namespace media_router {
+
+CastMediaSink::CastMediaSink(const MediaSink::Id& sink_id,
+ const std::string& name,
+ const MediaSink::IconType icon_type)
+ : MediaSink(sink_id, name, icon_type),
+ capabilities_(0),
+ cast_channel_id_(0) {
+ type_ = SinkType::CAST;
imcheng 2017/02/08 01:28:08 Can the type be passed into the base constructor?
zhaobin 2017/02/09 00:13:52 Done.
+}
+
+CastMediaSink::CastMediaSink(const CastMediaSink& other) = default;
+
+CastMediaSink::~CastMediaSink() = default;
+
+// static
+const CastMediaSink* CastMediaSink::Cast(const MediaSink* sink) {
+ DCHECK(sink->type() == MediaSink::SinkType::CAST);
+ return static_cast<const CastMediaSink*>(sink);
+}
+
+// static
+CastMediaSink* CastMediaSink::Cast(MediaSink* sink) {
+ DCHECK(sink->type() == MediaSink::SinkType::CAST);
+ return static_cast<CastMediaSink*>(sink);
+}
+
+} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698