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

Unified Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc

Issue 1475843002: [MR] Add description field to MediaSink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 5 years 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/ui/webui/media_router/media_router_webui_message_handler.cc
diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc
index 4c911f91eaafa04685bba485086dc294027472ea..ce1da635092c325752fc17ed8006473a08bc6f76 100644
--- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc
+++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc
@@ -53,12 +53,14 @@ scoped_ptr<base::ListValue> SinksToValue(
sink_val->SetString("id", sink.id());
sink_val->SetString("name", sink.name());
sink_val->SetInteger("iconType", sink.icon_type());
+ if (!sink.description().empty())
+ sink_val->SetString("description", sink.description());
scoped_ptr<base::ListValue> cast_modes_val(new base::ListValue);
for (MediaCastMode cast_mode : sink_with_cast_modes.cast_modes)
cast_modes_val->AppendInteger(cast_mode);
- sink_val->Set("castModes", cast_modes_val.Pass());
apacible 2015/12/02 23:27:26 Were the new lines here and below added/deleted ju
imcheng 2015/12/03 23:11:07 Yes. I find new line after indented statement help
+ sink_val->Set("castModes", cast_modes_val.Pass());
value->Append(sink_val.release());
}
@@ -68,14 +70,12 @@ scoped_ptr<base::ListValue> SinksToValue(
scoped_ptr<base::DictionaryValue> RouteToValue(
const MediaRoute& route, const std::string& extension_id) {
scoped_ptr<base::DictionaryValue> dictionary(new base::DictionaryValue);
-
dictionary->SetString("id", route.media_route_id());
dictionary->SetString("sinkId", route.media_sink_id());
dictionary->SetString("description", route.description());
dictionary->SetBoolean("isLocal", route.is_local());
const std::string& custom_path = route.custom_controller_path();
-
if (!custom_path.empty()) {
std::string full_custom_controller_path = base::StringPrintf("%s://%s/%s",
extensions::kExtensionScheme, extension_id.c_str(),

Powered by Google App Engine
This is Rietveld 408576698