Bug 1548253 - Port pref cache variables of nsContentUtils to StaticPrefs - full-screen-api.enabled, r=Ehsan

Differential Revision: https://phabricator.services.mozilla.com/D29500

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2019-05-01 21:39:01 +00:00
Родитель 260fdd0caa
Коммит 54e6e5339e
5 изменённых файлов: 8 добавлений и 18 удалений

Просмотреть файл

@ -10678,7 +10678,7 @@ static bool HasFullscreenSubDocument(Document* aDoc) {
// in the given document. Returns a static string indicates the reason
// why it is not enabled otherwise.
static const char* GetFullscreenError(Document* aDoc, CallerType aCallerType) {
bool apiEnabled = nsContentUtils::IsFullscreenApiEnabled();
bool apiEnabled = StaticPrefs::full_screen_api_enabled();
if (apiEnabled && aCallerType == CallerType::System) {
// Chrome code can always use the fullscreen API, provided it's not
// explicitly disabled.

Просмотреть файл

@ -310,7 +310,6 @@ nsString* nsContentUtils::sAltText = nullptr;
nsString* nsContentUtils::sModifierSeparator = nullptr;
bool nsContentUtils::sInitialized = false;
bool nsContentUtils::sIsFullscreenApiEnabled = false;
bool nsContentUtils::sIsUnprefixedFullscreenApiEnabled = false;
bool nsContentUtils::sTrustedFullscreenOnly = true;
bool nsContentUtils::sIsCutCopyAllowed = true;
@ -633,9 +632,6 @@ nsresult nsContentUtils::Init() {
Preferences::AddBoolVarCache(&sAllowXULXBL_for_file,
"dom.allow_XUL_XBL_for_file");
Preferences::AddBoolVarCache(&sIsFullscreenApiEnabled,
"full-screen-api.enabled");
Preferences::AddBoolVarCache(&sIsUnprefixedFullscreenApiEnabled,
"full-screen-api.unprefix.enabled");
@ -6667,11 +6663,6 @@ bool nsContentUtils::ChannelShouldInheritPrincipal(
return inherit;
}
/* static */
bool nsContentUtils::IsFullscreenApiEnabled() {
return sIsFullscreenApiEnabled;
}
/* static */
bool nsContentUtils::IsRequestFullscreenAllowed(CallerType aCallerType) {
// If more time has elapsed since the user input than is specified by the

Просмотреть файл

@ -2325,11 +2325,6 @@ class nsContentUtils {
*/
static bool IsFocusedContent(const nsIContent* aContent);
/**
* Returns true if the DOM fullscreen API is enabled.
*/
static bool IsFullscreenApiEnabled();
/**
* Returns true if the unprefixed fullscreen API is enabled.
*/
@ -3502,7 +3497,6 @@ class nsContentUtils {
static bool sIsHandlingKeyBoardEvent;
static bool sAllowXULXBL_for_file;
static bool sIsFullscreenApiEnabled;
static bool sIsUnprefixedFullscreenApiEnabled;
static bool sTrustedFullscreenOnly;
static bool sIsCutCopyAllowed;

Просмотреть файл

@ -597,7 +597,6 @@ VARCACHE_PREF(
bool, true
)
// Allow the content process to create a File from a path. This is allowed just
// on parent process, on 'file' Content process, or for testing.
VARCACHE_PREF(
@ -606,6 +605,13 @@ VARCACHE_PREF(
RelaxedAtomicBool, false
)
// DOM full-screen API.
VARCACHE_PREF(
"full-screen-api.enabled",
full_screen_api_enabled,
bool, false
)
//---------------------------------------------------------------------------
// Extension prefs
//---------------------------------------------------------------------------

Просмотреть файл

@ -5287,7 +5287,6 @@ pref("alerts.useSystemBackend", true);
#endif
// DOM full-screen API.
pref("full-screen-api.enabled", false);
pref("full-screen-api.allow-trusted-requests-only", true);
// whether to prevent the top level widget from going fullscreen
pref("full-screen-api.ignore-widgets", false);