Android build for ungoogled-chromium. https://uc.droidware.info
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

49 lines
2.0 KiB

From 75c087d108655330beabb7729432b083e625e925 Mon Sep 17 00:00:00 2001
From: Daniel Micay <[email protected]>
Date: Thu, 4 Jul 2019 19:08:52 -0400
Subject: [PATCH 21/30] disable media router by default
---
chrome/browser/media/router/media_router_feature.cc | 17 ++++++++---------
chrome/browser/profiles/profile_impl.cc | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
--- a/chrome/browser/media/router/media_router_feature.cc
+++ b/chrome/browser/media/router/media_router_feature.cc
@@ -50,17 +50,16 @@ const PrefService::Preference* GetMediaR
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)
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -409,7 +409,7 @@ void ProfileImpl::RegisterProfilePrefs(
#endif
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
#if defined(OS_CHROMEOS)
registry->RegisterBooleanPref(
prefs::kOobeMarketingOptInScreenFinished, false,