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

Unified Diff: chrome/browser/media/router/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/media_sink.h
diff --git a/chrome/browser/media/router/media_sink.h b/chrome/browser/media/router/media_sink.h
index e12b6b16f55de968635b3955b6f2484c8dfe3d5e..c896e0ccf9443016dec5cdb6dfa253e443579395 100644
--- a/chrome/browser/media/router/media_sink.h
+++ b/chrome/browser/media/router/media_sink.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/optional.h"
#include "third_party/icu/source/common/unicode/uversion.h"
namespace U_ICU_NAMESPACE {
@@ -31,6 +32,10 @@ class MediaSink {
GENERIC
};
+ // SinkType indicates if sink is discovered by DIAL / CAST / other (e.g.
+ // cloud) media sink services. Used by mojo.
imcheng 2017/02/08 01:28:09 1) Remove "Used by mojo." 2) I would point out tha
zhaobin 2017/02/09 00:13:52 Done.
+ enum class SinkType { DIAL, CAST, GENERAL };
imcheng 2017/02/08 01:28:09 s/GENERAL/GENERIC
zhaobin 2017/02/09 00:13:52 Done.
+
MediaSink(const MediaSink::Id& sink_id,
const std::string& name,
const IconType icon_type);
@@ -39,15 +44,22 @@ class MediaSink {
~MediaSink();
imcheng 2017/02/08 01:28:09 This needs to be virtual now.
dcheng 2017/02/08 03:01:05 Hmm. Our compiler is supposed to warn on this. zha
zhaobin 2017/02/09 00:13:52 # Build arguments go here. Examples: # is_compon
zhaobin 2017/02/09 00:13:52 Done.
dcheng 2017/02/09 00:33:23 Ah doh.... this is a known bug =( https://llvm.org
imcheng 2017/02/09 02:19:57 Wouldn't stack allocated objects (which I am prett
+ SinkType type() const { return type_; }
const MediaSink::Id& id() const { return sink_id_; }
const std::string& name() const { return name_; }
void set_description(const std::string& description) {
description_ = description;
}
- const std::string& description() const { return description_; }
+ const base::Optional<std::string>& description() const {
+ return description_;
+ }
void set_domain(const std::string& domain) { domain_ = domain; }
- const std::string& domain() const { return domain_; }
+ const base::Optional<std::string>& domain() const { return domain_; }
IconType icon_type() const { return icon_type_; }
+ void set_model_name(const std::string& model_name) {
+ model_name_ = model_name;
+ }
+ const base::Optional<std::string>& model_name() const { return model_name_; }
bool Equals(const MediaSink& other) const;
imcheng 2017/02/08 01:28:09 I would add a note here that this method only comp
zhaobin 2017/02/09 00:13:52 Done.
@@ -63,6 +75,10 @@ class MediaSink {
}
};
+ protected:
+ // Type of the MediaSink.
+ SinkType type_;
+
private:
// Unique identifier for the MediaSink.
MediaSink::Id sink_id_;
@@ -71,13 +87,16 @@ class MediaSink {
std::string name_;
// Optional description of the MediaSink.
imcheng 2017/02/08 01:28:09 This comment doesn't add much - remove?
zhaobin 2017/02/09 00:13:52 Done.
- std::string description_;
+ base::Optional<std::string> description_;
// Optional domain of the MediaSink.
imcheng 2017/02/08 01:28:09 ditto
zhaobin 2017/02/09 00:13:52 Done.
- std::string domain_;
+ base::Optional<std::string> domain_;
// The type of icon that corresponds with the MediaSink.
IconType icon_type_;
+
+ // Optional model name of the MediaSink.
imcheng 2017/02/08 01:28:09 ditto, or "Model name of the sink, if it represent
zhaobin 2017/02/09 00:13:52 Done.
+ base::Optional<std::string> model_name_;
};
} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698