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

Unified Diff: chrome/browser/media/router/cast_media_sink.h

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.h
diff --git a/chrome/browser/media/router/cast_media_sink.h b/chrome/browser/media/router/cast_media_sink.h
new file mode 100644
index 0000000000000000000000000000000000000000..d4fc556d1043dd05fa62fd571176b78b64c22f45
--- /dev/null
+++ b/chrome/browser/media/router/cast_media_sink.h
@@ -0,0 +1,49 @@
+// 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.
+
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_CAST_MEDIA_SINK_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_CAST_MEDIA_SINK_H_
+
+#include "chrome/browser/media/router/media_sink.h"
+
+namespace media_router {
+
+// Represents a cast sink to which media can be routed.
+class CastMediaSink : public MediaSink {
+ public:
+ CastMediaSink(const MediaSink::Id& sink_id,
+ const std::string& name,
+ const IconType icon_type);
+ CastMediaSink(const CastMediaSink& other);
+ ~CastMediaSink();
+
+ int capabilities() const { return capabilities_; }
+ void set_capabilities(int capabilities) { capabilities_ = capabilities; }
+ const std::string& ip_address() const { return ip_address_; }
+ void set_ip_address(const std::string& ip_address) {
+ ip_address_ = ip_address;
+ }
+ int cast_channel_id() const { return cast_channel_id_; }
+ void set_cast_channel_id(int cast_channel_id) {
+ cast_channel_id_ = cast_channel_id;
+ }
+
+ // Used by mojo.
+ static const CastMediaSink* Cast(const MediaSink* sink);
+ static CastMediaSink* Cast(MediaSink* sink);
+
+ private:
+ int capabilities_;
imcheng 2017/02/08 01:28:08 Please add a comment: // A bit vector representin
zhaobin 2017/02/09 00:13:52 Done.
+
+ // Used for feedback
imcheng 2017/02/08 01:28:08 We probably don't need this comment.
zhaobin 2017/02/09 00:13:52 Done.
+ std::string ip_address_;
+
+ // ID of cast channel opened by Media Router. The ID can be
imcheng 2017/02/08 01:28:08 // ID of Cast channel opened for the sink.
zhaobin 2017/02/09 00:13:52 Done.
+ // used to send call chrome.cast.channel.send.
+ int cast_channel_id_;
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_CAST_MEDIA_SINK_H_

Powered by Google App Engine
This is Rietveld 408576698