-
Notifications
You must be signed in to change notification settings - Fork 0
/
3992-old.patch
79 lines (69 loc) · 2.87 KB
/
3992-old.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--- a/chrome/browser/media/router/media_router_feature.cc 2017-10-11 15:10:22.000000000 -0400
+++ b/chrome/browser/media/router/media_router_feature.cc 2017-10-15 10:01:55.341432773 -0400
@@ -11,22 +11,22 @@
#include "extensions/features/features.h"
#include "ui/base/ui_features.h"
-#if defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
+
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/user_prefs/user_prefs.h"
-#endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
+
namespace media_router {
-#if !defined(OS_ANDROID)
+
// Controls if browser side DIAL sink query is enabled.
const base::Feature kEnableDialSinkQuery{"EnableDialSinkQuery",
base::FEATURE_DISABLED_BY_DEFAULT};
// Controls if browser side Cast device discovery is enabled.
const base::Feature kEnableCastDiscovery{"EnableCastDiscovery",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kCastMediaRouteProvider{"CastMediaRouteProvider",
base::FEATURE_DISABLED_BY_DEFAULT};
@@ -34,9 +34,7 @@
// Controls if local media casting is enabled.
const base::Feature kEnableCastLocalMedia{"EnableCastLocalMedia",
base::FEATURE_DISABLED_BY_DEFAULT};
-#endif
-#if defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
namespace {
const PrefService::Preference* GetMediaRouterPref(
content::BrowserContext* context) {
@@ -44,10 +42,10 @@
prefs::kEnableMediaRouter);
}
} // namespace
-#endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
+
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()) {
@@ -58,13 +56,9 @@
// The component extension cannot be loaded in guest sessions.
// TODO(crbug.com/756243): Figure out why.
- return !Profile::FromBrowserContext(context)->IsGuestSession();
-#else // !(defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS))
return false;
-#endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
}
-#if !defined(OS_ANDROID)
// Returns true if browser side DIAL sink query is enabled.
bool DialSinkQueryEnabled() {
return base::FeatureList::IsEnabled(kEnableDialSinkQuery);
@@ -87,12 +81,7 @@
// Returns true if the presentation receiver window for local media casting is
// available on the current platform.
bool PresentationReceiverWindowEnabled() {
-#if defined(OS_MACOSX) && !BUILDFLAG(MAC_VIEWS_BROWSER)
- return false;
-#else
return true;
-#endif
}
-#endif
} // namespace media_router