|
@@ -0,0 +1,66 @@
|
|
|
+From: Daniel Micay <danielmicay@gmail.com>
|
|
|
+Date: Thu, 4 Jul 2019 19:08:52 -0400
|
|
|
+Subject: Disable media router and remoting by default
|
|
|
+
|
|
|
+---
|
|
|
+ chrome/browser/media/router/media_router_feature.cc | 17 ++++++++---------
|
|
|
+ chrome/browser/profiles/profile.cc | 2 +-
|
|
|
+ chrome/browser/profiles/profile_impl.cc | 2 +-
|
|
|
+ 3 files changed, 10 insertions(+), 11 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
|
|
|
+@@ -56,17 +56,16 @@ const PrefService::Preference* GetMediaRouterPref(
|
|
|
+
|
|
|
+ bool MediaRouterEnabled(content::BrowserContext* context) {
|
|
|
+ #if defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
|
|
|
+- const PrefService::Preference* pref = GetMediaRouterPref(context);
|
|
|
+- // Only use the pref value if it set from a mandatory policy.
|
|
|
+- if (pref->IsManaged() && !pref->IsDefaultValue()) {
|
|
|
+- bool allowed = false;
|
|
|
+- CHECK(pref->GetValue()->GetAsBoolean(&allowed));
|
|
|
+- return allowed;
|
|
|
+- }
|
|
|
+-
|
|
|
+ // The component extension cannot be loaded in guest sessions.
|
|
|
+ // TODO(crbug.com/756243): Figure out why.
|
|
|
+- return !Profile::FromBrowserContext(context)->IsGuestSession();
|
|
|
++ if (Profile::FromBrowserContext(context)->IsGuestSession()) {
|
|
|
++ return false;
|
|
|
++ }
|
|
|
++
|
|
|
++ const PrefService::Preference* pref = GetMediaRouterPref(context);
|
|
|
++ bool allowed = false;
|
|
|
++ pref->GetValue()->GetAsBoolean(&allowed);
|
|
|
++ return allowed;
|
|
|
+ #else // !(defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS))
|
|
|
+ return false;
|
|
|
+ #endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
|
|
|
+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
|
|
|
+@@ -218,7 +218,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
|
|
+ prefs::kMediaRouterFirstRunFlowAcknowledged,
|
|
|
+ false,
|
|
|
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
|
|
+- registry->RegisterBooleanPref(prefs::kMediaRouterMediaRemotingEnabled, true);
|
|
|
++ registry->RegisterBooleanPref(prefs::kMediaRouterMediaRemotingEnabled, false);
|
|
|
+ registry->RegisterListPref(prefs::kMediaRouterTabMirroringSources);
|
|
|
+
|
|
|
+ registry->RegisterDictionaryPref(prefs::kWebShareVisitedTargets);
|
|
|
+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
|
|
|
+@@ -443,7 +443,7 @@ void ProfileImpl::RegisterProfilePrefs(
|
|
|
+ registry->RegisterStringPref(
|
|
|
+ prefs::kPrintPreviewDefaultDestinationSelectionRules, std::string());
|
|
|
+ registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
|
|
|
+- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
|
|
|
++ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
|
|
|
+ #if defined(OS_CHROMEOS)
|
|
|
+ registry->RegisterBooleanPref(
|
|
|
+ prefs::kOobeMarketingOptInScreenFinished, false,
|
|
|
+--
|
|
|
+2.11.0
|
|
|
+
|