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

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: Also filter sinks with a domain 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..be88b40ca391b1931926846aed2e300e7ca94b46 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,22 @@ void CastDeviceCache::Init() {
}
void CastDeviceCache::OnSinksReceived(const MediaSinks& sinks) {
- sinks_ = sinks;
+ sinks_.clear();
+ for (const media_router::MediaSink& sink : 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.
+ if (sink.name().empty())
+ continue;
+
+ // Temporarily hide sinks that have a domain. This is to meet cast privacy
+ // requirements. See bug/28691645.
+ if (!sink.domain().empty())
+ 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