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

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

Issue 2666873006: [Media Router] Convert to use typemaps for media_router.mojom. (Closed)
Patch Set: fix android compile 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..e2e887ba606b6b7f22c189ba546e811f623b9667 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 {
@@ -44,9 +45,11 @@ class MediaSink {
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_; }
bool Equals(const MediaSink& other) const;
@@ -63,6 +66,12 @@ class MediaSink {
}
};
+ // Used by Mojo.
+ MediaSink();
mark a. foltz 2017/02/07 00:57:43 Declare with other ctors?
imcheng 2017/02/07 01:36:04 Done.
+ void set_sink_id(const MediaSink::Id& sink_id) { sink_id_ = sink_id; }
+ void set_name(const std::string& name) { name_ = name; }
+ void set_icon_type(IconType icon_type) { icon_type_ = icon_type; }
+
private:
// Unique identifier for the MediaSink.
MediaSink::Id sink_id_;
@@ -71,13 +80,13 @@ class MediaSink {
std::string name_;
// Optional description of the MediaSink.
- std::string description_;
+ base::Optional<std::string> description_;
// Optional domain of the MediaSink.
- std::string domain_;
+ base::Optional<std::string> domain_;
// The type of icon that corresponds with the MediaSink.
- IconType icon_type_;
+ IconType icon_type_ = IconType::GENERIC;
};
} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698