From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 4 Jul 2019 19:08:52 -0400
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 ++++++-------------
 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
@@ -59,26 +59,15 @@ 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;
@@ -106,7 +95,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
     return allowed;
   }
   return true;
-}
+}*/
 
 #if !BUILDFLAG(IS_ANDROID)
 void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
@@ -119,7 +108,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
@@ -411,7 +411,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
