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

Unified Diff: chrome/browser/ui/ash/cast_config_delegate_media_router.cc

Issue 2029963002: Hide media sinks that don't have a name in the cast system tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/cast_config_delegate_media_router.cc
diff --git a/chrome/browser/ui/ash/cast_config_delegate_media_router.cc b/chrome/browser/ui/ash/cast_config_delegate_media_router.cc
index 304b27d446f0353c9beff87cd830bfef94cca5bf..1e596e5c081c147469eab9632db094dd12837d4d 100644
--- a/chrome/browser/ui/ash/cast_config_delegate_media_router.cc
+++ b/chrome/browser/ui/ash/cast_config_delegate_media_router.cc
@@ -95,7 +95,17 @@ void CastDeviceCache::Init() {
}
void CastDeviceCache::OnSinksReceived(const MediaSinks& sinks) {
- sinks_ = sinks;
+ // The media router adds a MediaSink instance that doesn't have a name. Make
+ // sure to filter that sink out from the UI so it is not rendered, as it will
+ // be a line that only has a icon with no apparent meaning.
+ sinks_.clear();
+ for (const media_router::MediaSink& sink : sinks) {
+ if (sink.name().empty())
amp 2016/06/02 16:49:24 Until we can duplicate the logic in https://cs.chr
jdufault 2016/06/02 17:35:14 Done.
+ continue;
+
+ sinks_.push_back(sink);
+ }
+
cast_config_delegate_->RequestDeviceRefresh();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698