Files
cromite/build/patches/Disable-media-router-and-remoting-by-default.patch
2021-10-16 22:28:37 +02:00

83 lines
3.0 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 | 25 ++++++-------------
chrome/browser/profiles/profile.cc | 2 +-
chrome/browser/profiles/profile_impl.cc | 2 +-
3 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
@@ -37,26 +37,15 @@ const base::Feature kAllowAllSitesToInitiateMirroring{
"AllowAllSitesToInitiateMirroring", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // !defined(OS_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 !defined(OS_ANDROID)
if (!base::FeatureList::IsEnabled(kMediaRouter))
return false;
@@ -80,7 +69,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
return allowed;
}
return true;
-}
+}*/
#if !defined(OS_ANDROID)
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -356,7 +356,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
media_router::prefs::kMediaRouterEnableCloudServices, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
- media_router::prefs::kMediaRouterMediaRemotingEnabled, true);
+ media_router::prefs::kMediaRouterMediaRemotingEnabled, false);
registry->RegisterListPref(
media_router::prefs::kMediaRouterTabMirroringSources);
#endif
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
@@ -434,7 +434,7 @@ void ProfileImpl::RegisterProfilePrefs(
#endif
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
#if !defined(OS_ANDROID)
registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false);
#endif // !defined(OS_ANDROID)
--
2.17.1