Files
cromite/build/patches/Disable-media-router-and-remoting-by-default.patch
2022-05-28 12:06:53 +02:00

78 lines
2.6 KiB
Diff

From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 4 Jul 2019 19:08:52 -0400
Subject: Disable media router and remoting by default
---
.../media/router/media_router_feature.cc | 27 ++++++-------------
chrome/browser/profiles/profile_impl.cc | 2 +-
2 files changed, 9 insertions(+), 20 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
@@ -50,26 +50,15 @@ const base::Feature kGlobalMediaControlsCastStartStop{
#endif // !BUILDFLAG(IS_ANDROID)
-namespace {
-const PrefService::Preference* GetMediaRouterPref(
- content::BrowserContext* context) {
- return user_prefs::UserPrefs::Get(context)->FindPreference(
- ::prefs::kEnableMediaRouter);
-}
-
-base::flat_map<content::BrowserContext*, bool>& GetStoredPrefValues() {
- static base::NoDestructor<base::flat_map<content::BrowserContext*, bool>>
- stored_pref_values;
-
- return *stored_pref_values;
-}
-} // namespace
-
-void ClearMediaRouterStoredPrefsForTesting() {
+/*void ClearMediaRouterStoredPrefsForTesting() {
GetStoredPrefValues().clear();
-}
+}*/
bool MediaRouterEnabled(content::BrowserContext* context) {
+ return false;
+}
+
+/*
#if !BUILDFLAG(IS_ANDROID)
if (!base::FeatureList::IsEnabled(kMediaRouter))
return false;
@@ -93,7 +82,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
return allowed;
}
return true;
-}
+}*/
#if !BUILDFLAG(IS_ANDROID)
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
@@ -106,7 +95,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
PrefRegistry::PUBLIC);
registry->RegisterBooleanPref(
- media_router::prefs::kMediaRouterMediaRemotingEnabled, true);
+ media_router::prefs::kMediaRouterMediaRemotingEnabled, false); // disabled in Bromite
registry->RegisterListPref(
media_router::prefs::kMediaRouterTabMirroringSources);
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -417,7 +417,7 @@ void ProfileImpl::RegisterProfilePrefs(
#endif
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
#if !BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false);
#endif // !BUILDFLAG(IS_ANDROID)
--
2.25.1