Bug 1335368 part 4. Stop using IsCallerChrome in nsContentUtils::IsRequestFullScreenAllowed. r=bholley

This commit is contained in:
Boris Zbarsky 2017-02-01 15:43:36 -05:00
Родитель 80365681f6
Коммит 4dafb92c93
3 изменённых файлов: 6 добавлений и 6 удалений

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

@ -3315,9 +3315,9 @@ Element::AttrValueToCORSMode(const nsAttrValue* aValue)
}
static const char*
GetFullScreenError(nsIDocument* aDoc)
GetFullScreenError(CallerType aCallerType)
{
if (!nsContentUtils::IsRequestFullScreenAllowed()) {
if (!nsContentUtils::IsRequestFullScreenAllowed(aCallerType)) {
return "FullscreenDeniedNotInputDriven";
}
@ -3334,7 +3334,7 @@ Element::RequestFullscreen(CallerType aCallerType, ErrorResult& aError)
// spoof the browser chrome/window and phish logins etc.
// Note that requests for fullscreen inside a web app's origin are exempt
// from this restriction.
if (const char* error = GetFullScreenError(OwnerDoc())) {
if (const char* error = GetFullScreenError(aCallerType)) {
OwnerDoc()->DispatchFullscreenError(error);
return;
}

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

@ -6831,11 +6831,11 @@ nsContentUtils::IsFullScreenApiEnabled()
/* static */
bool
nsContentUtils::IsRequestFullScreenAllowed()
nsContentUtils::IsRequestFullScreenAllowed(CallerType aCallerType)
{
return !sTrustedFullScreenOnly ||
EventStateManager::IsHandlingUserInput() ||
IsCallerChrome();
aCallerType == CallerType::System;
}
/* static */

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

@ -2000,7 +2000,7 @@ public:
* a mouse-click or key press), unless this check has been disabled by
* setting the pref "full-screen-api.allow-trusted-requests-only" to false.
*/
static bool IsRequestFullScreenAllowed();
static bool IsRequestFullScreenAllowed(mozilla::dom::CallerType aCallerType);
/**
* Returns true if calling execCommand with 'cut' or 'copy' arguments