Bug 1325028 part 5. Change nsGlonalWindow::CanMoveResizeWindows to take CallerType. r=bkelly

This commit is contained in:
Boris Zbarsky 2016-12-22 11:06:32 -08:00
Родитель 7cd914777b
Коммит 9023b20a12
2 изменённых файлов: 9 добавлений и 9 удалений

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

@ -6880,12 +6880,12 @@ nsGlobalWindow::MakeScriptDialogTitle(nsAString& aOutTitle,
}
bool
nsGlobalWindow::CanMoveResizeWindows(bool aCallerIsChrome)
nsGlobalWindow::CanMoveResizeWindows(CallerType aCallerType)
{
MOZ_ASSERT(IsOuterWindow());
// When called from chrome, we can avoid the following checks.
if (!aCallerIsChrome) {
if (aCallerType != CallerType::System) {
// Don't allow scripts to move or resize windows that were not opened by a
// script.
if (!mHadOriginalOpener) {
@ -7539,7 +7539,7 @@ nsGlobalWindow::MoveToOuter(int32_t aXPos, int32_t aYPos,
* prevent window.moveTo() by exiting early
*/
if (!CanMoveResizeWindows(aCallerType == CallerType::System) || IsFrame()) {
if (!CanMoveResizeWindows(aCallerType) || IsFrame()) {
return;
}
@ -7607,7 +7607,7 @@ nsGlobalWindow::MoveByOuter(int32_t aXDif, int32_t aYDif,
* prevent window.moveBy() by exiting early
*/
if (!CanMoveResizeWindows(aCallerType == CallerType::System) || IsFrame()) {
if (!CanMoveResizeWindows(aCallerType) || IsFrame()) {
return;
}
@ -7686,7 +7686,7 @@ nsGlobalWindow::ResizeToOuter(int32_t aWidth, int32_t aHeight,
* prevent window.resizeTo() by exiting early
*/
if (!CanMoveResizeWindows(aCallerType == CallerType::System) || IsFrame()) {
if (!CanMoveResizeWindows(aCallerType) || IsFrame()) {
return;
}
@ -7745,7 +7745,7 @@ nsGlobalWindow::ResizeByOuter(int32_t aWidthDif, int32_t aHeightDif,
* prevent window.resizeBy() by exiting early
*/
if (!CanMoveResizeWindows(aCallerType == CallerType::System) || IsFrame()) {
if (!CanMoveResizeWindows(aCallerType) || IsFrame()) {
return;
}
@ -7802,7 +7802,7 @@ nsGlobalWindow::SizeToContentOuter(CallerType aCallerType, ErrorResult& aError)
* prevent window.sizeToContent() by exiting early
*/
if (!CanMoveResizeWindows(aCallerType == CallerType::System) || IsFrame()) {
if (!CanMoveResizeWindows(aCallerType) || IsFrame()) {
return;
}
@ -14048,7 +14048,7 @@ nsGlobalWindow::SetReplaceableWindowCoord(JSContext* aCx,
*/
nsGlobalWindow* outer = GetOuterWindowInternal();
if (!outer ||
!outer->CanMoveResizeWindows(aCallerType == CallerType::System) ||
!outer->CanMoveResizeWindows(aCallerType) ||
outer->IsFrame()) {
RedefineProperty(aCx, aPropName, aValue, aError);
return;

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

@ -1598,7 +1598,7 @@ public:
nsIPrincipal* aSubjectPrincipal);
// Outer windows only.
bool CanMoveResizeWindows(bool aCallerIsChrome);
bool CanMoveResizeWindows(mozilla::dom::CallerType aCallerType);
// If aDoFlush is true, we'll flush our own layout; otherwise we'll try to
// just flush our parent and only flush ourselves if we think we need to.