Bug 1267339 part 1. Remove the unused aOpenerFullZoom argument to nsPIWindowWatcher::OpenWindow2. r=mconley

This commit is contained in:
Boris Zbarsky 2016-10-20 16:52:37 -04:00
parent a206dd4eff
commit fe57b51a79
5 changed files with 15 additions and 26 deletions

View File

@ -11896,7 +11896,7 @@ nsGlobalWindow::OpenInternal(const nsAString& aUrl, const nsAString& aName,
rv = pwwatch->OpenWindow2(AsOuter(), url.get(), name_ptr,
options_ptr, /* aCalledFromScript = */ true,
aDialog, aNavigate, argv,
1.0f, 0, getter_AddRefs(domReturn));
getter_AddRefs(domReturn));
} else {
// Force a system caller here so that the window watcher won't screw us
// up. We do NOT want this case looking at the JS context on the stack
@ -11916,7 +11916,7 @@ nsGlobalWindow::OpenInternal(const nsAString& aUrl, const nsAString& aName,
rv = pwwatch->OpenWindow2(AsOuter(), url.get(), name_ptr,
options_ptr, /* aCalledFromScript = */ false,
aDialog, aNavigate, aExtraArgument,
1.0f, 0, getter_AddRefs(domReturn));
getter_AddRefs(domReturn));
}
}

View File

@ -606,7 +606,7 @@ private:
spec.get(),
nullptr,
nullptr,
false, false, true, nullptr, 1.0f, 0,
false, false, true, nullptr,
getter_AddRefs(newWindow));
nsCOMPtr<nsPIDOMWindowOuter> pwindow = nsPIDOMWindowOuter::From(newWindow);
pwindow.forget(aWindow);

View File

@ -55,9 +55,6 @@ interface nsPIWindowWatcher : nsISupports
@param aNavigate true if we should navigate the new window to the
specified URL.
@param aArgs Window argument
@param aOpenerFullZoom the full zoom multiplier for the opener window.
this can be null in the single process case where
the opener full zoom is obtained from aParent.
@return the new window
@note This method may examine the JS context stack for purposes of
@ -68,14 +65,12 @@ interface nsPIWindowWatcher : nsISupports
(which is determined based on the JS stack and the value of
aParent). This is not guaranteed, however.
*/
[optional_argc]
mozIDOMWindowProxy openWindow2(in mozIDOMWindowProxy aParent, in string aUrl,
in string aName, in string aFeatures,
in boolean aCalledFromScript,
in boolean aDialog,
in boolean aNavigate,
in nsISupports aArgs,
[optional] in float aOpenerFullZoom);
in nsISupports aArgs);
/**
* Opens a new window using the most recent non-private browser

View File

@ -371,8 +371,7 @@ nsWindowWatcher::OpenWindow(mozIDOMWindowProxy* aParent,
return OpenWindowInternal(aParent, aUrl, aName, aFeatures,
/* calledFromJS = */ false, dialog,
/* navigate = */ true, argv,
/* openerFullZoom = */ nullptr, aResult);
/* navigate = */ true, argv, aResult);
}
struct SizeSpec
@ -435,8 +434,6 @@ nsWindowWatcher::OpenWindow2(mozIDOMWindowProxy* aParent,
bool aDialog,
bool aNavigate,
nsISupports* aArguments,
float aOpenerFullZoom,
uint8_t aOptionalArgc,
mozIDOMWindowProxy** aResult)
{
nsCOMPtr<nsIArray> argv = ConvertArgsToArray(aArguments);
@ -457,7 +454,6 @@ nsWindowWatcher::OpenWindow2(mozIDOMWindowProxy* aParent,
return OpenWindowInternal(aParent, aUrl, aName, aFeatures,
aCalledFromScript, dialog,
aNavigate, argv,
aOptionalArgc >= 1 ? &aOpenerFullZoom : nullptr,
aResult);
}
@ -673,7 +669,7 @@ nsWindowWatcher::OpenWindowWithTabParent(nsITabParent* aOpeningTabParent,
SizeSpec sizeSpec;
CalcSizeSpec(aFeatures, sizeSpec);
SizeOpenedWindow(chromeTreeOwner, parentWindowOuter, false, sizeSpec,
&aOpenerFullZoom);
Some(aOpenerFullZoom));
nsCOMPtr<nsITabParent> newTabParent;
chromeTreeOwner->GetPrimaryTabParent(getter_AddRefs(newTabParent));
@ -694,7 +690,6 @@ nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent,
bool aDialog,
bool aNavigate,
nsIArray* aArgv,
float* aOpenerFullZoom,
mozIDOMWindowProxy** aResult)
{
nsresult rv = NS_OK;
@ -1254,8 +1249,7 @@ nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent,
if (isNewToplevelWindow) {
nsCOMPtr<nsIDocShellTreeOwner> newTreeOwner;
newDocShellItem->GetTreeOwner(getter_AddRefs(newTreeOwner));
SizeOpenedWindow(newTreeOwner, aParent, isCallerChrome, sizeSpec,
aOpenerFullZoom);
SizeOpenedWindow(newTreeOwner, aParent, isCallerChrome, sizeSpec);
}
// XXXbz isn't windowIsModal always true when windowIsModalContentDialog?
@ -2273,21 +2267,20 @@ nsWindowWatcher::CalcSizeSpec(const nsACString& aFeatures, SizeSpec& aResult)
The top-level nsIDocShellTreeOwner of the newly opened window.
@param aParent (optional)
The parent window from which to inherit zoom factors from if
aOpenerFullZoom isn't passed.
aOpenerFullZoom is none.
@param aIsCallerChrome
True if the code requesting the new window is privileged.
@param aSizeSpec
The size that the new window should be.
@param aOpenerFullZoom
An optional pointer to a zoom factor to scale the content
to.
If not nothing, a zoom factor to scale the content to.
*/
void
nsWindowWatcher::SizeOpenedWindow(nsIDocShellTreeOwner* aTreeOwner,
mozIDOMWindowProxy* aParent,
bool aIsCallerChrome,
const SizeSpec& aSizeSpec,
float* aOpenerFullZoom)
Maybe<float> aOpenerFullZoom)
{
// We should only be sizing top-level windows if we're in the parent
// process.
@ -2306,8 +2299,8 @@ nsWindowWatcher::SizeOpenedWindow(nsIDocShellTreeOwner* aTreeOwner,
return;
}
double openerZoom = aOpenerFullZoom ? *aOpenerFullZoom : 1.0;
if (aParent && !aOpenerFullZoom) {
double openerZoom = aOpenerFullZoom.valueOr(1.0);
if (aParent && aOpenerFullZoom.isNothing()) {
nsCOMPtr<nsPIDOMWindowOuter> piWindow = nsPIDOMWindowOuter::From(aParent);
if (nsIDocument* doc = piWindow->GetDoc()) {
if (nsIPresShell* shell = doc->GetShell()) {

View File

@ -13,6 +13,7 @@
#include "nsCOMPtr.h"
#include "mozilla/Mutex.h"
#include "mozilla/Maybe.h"
#include "nsIWindowCreator.h" // for stupid compilers
#include "nsIWindowWatcher.h"
#include "nsIPromptFactory.h"
@ -83,7 +84,6 @@ protected:
bool aDialog,
bool aNavigate,
nsIArray* aArgv,
float* aOpenerFullZoom,
mozIDOMWindowProxy** aResult);
static nsresult URIfromURL(const char* aURL,
@ -111,7 +111,8 @@ protected:
mozIDOMWindowProxy* aParent,
bool aIsCallerChrome,
const SizeSpec& aSizeSpec,
float* aOpenerFullZoom);
mozilla::Maybe<float> aOpenerFullZoom =
mozilla::Nothing());
static void GetWindowTreeItem(mozIDOMWindowProxy* aWindow,
nsIDocShellTreeItem** aResult);
static void GetWindowTreeOwner(nsPIDOMWindowOuter* aWindow,