diff --git a/build/patches/Disable-media-router-and-remoting-by-default.patch b/build/patches/Disable-media-router-and-remoting-by-default.patch index b4ed53bb..49b984d4 100644 --- a/build/patches/Disable-media-router-and-remoting-by-default.patch +++ b/build/patches/Disable-media-router-and-remoting-by-default.patch @@ -5,13 +5,23 @@ Subject: Disable media router and remoting by default Original License: MIT - https://spdx.org/licenses/MIT.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../media/router/media_router_feature.cc | 27 ++++++------------- + .../media/router/media_router_feature.cc | 29 ++++++------------- chrome/browser/profiles/profile_impl.cc | 2 +- - 2 files changed, 9 insertions(+), 20 deletions(-) + .../media_item_ui_helper.cc | 3 ++ + 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc --- a/chrome/browser/media/router/media_router_feature.cc +++ b/chrome/browser/media/router/media_router_feature.cc +@@ -49,7 +49,7 @@ BASE_FEATURE(kCastAnotherContentWhileCasting, + "CastAnotherContentWhileCasting", + base::FEATURE_ENABLED_BY_DEFAULT); + #else +-BASE_FEATURE(kMediaRouter, "MediaRouter", base::FEATURE_ENABLED_BY_DEFAULT); ++BASE_FEATURE(kMediaRouter, "MediaRouter", base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kCastAllowAllIPsFeature, + "CastAllowAllIPs", + base::FEATURE_DISABLED_BY_DEFAULT); @@ -79,26 +79,15 @@ BASE_FEATURE(kGlobalMediaControlsCastStartStop, #endif // BUILDFLAG(IS_CHROMEOS) #endif // BUILDFLAG(IS_ANDROID) @@ -75,5 +85,18 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/p #if !BUILDFLAG(IS_ANDROID) registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false); #endif // !BUILDFLAG(IS_ANDROID) +diff --git a/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc b/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc +--- a/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc ++++ b/chrome/browser/ui/views/global_media_controls/media_item_ui_helper.cc +@@ -63,6 +63,9 @@ absl::optional GetSessionRoute( + const std::string& item_id, + base::WeakPtr item, + content::BrowserContext* context) { ++ if (!media_router::MediaRouterEnabled(context)) { ++ return absl::nullopt; ++ } + // Return absl::nullopt if the item is not a local media session. + if (!item || item->SourceType() != + media_message_center::SourceType::kLocalMediaSession) { -- 2.25.1