/
0024-disable-media-router-by-default.patch
56 lines (52 loc) · 2.41 KB
/
0024-disable-media-router-by-default.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From e0baafcc2407e02d9165780d687b6c190331189f Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 4 Jul 2019 19:08:52 -0400
Subject: [PATCH 24/24] disable media router by default
---
.../media/router/media_router_feature.cc | 17 ++++++++---------
chrome/browser/profiles/profile_impl.cc | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
index 9c42d30ecd22..e773dd54ad9e 100644
--- 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_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 86ffb0c6cfc3..e32f0e7b83fe 100644
--- 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.23.0