Backed out 2 changesets (bug 1134891) for bc1 orange on a CLOSED TREE

Backed out changeset 7b021e23ff21 (bug 1134891)
Backed out changeset ec627a9f91c1 (bug 1134891)
This commit is contained in:
Wes Kocher 2015-02-24 15:58:25 -08:00
parent 1c767dd0c0
commit d57a1f1266
3 changed files with 52 additions and 65 deletions

View File

@ -42,21 +42,55 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(nsIDOMWindow *parent,
nsIObserver *openDialogObserver,
bool *notifyOnOpen)
{
MOZ_ASSERT_UNREACHABLE("The nsPrintingPromptService::ShowProgress "
"implementation for OS X returns "
"NS_ERROR_NOT_IMPLEMENTED, so we should never get "
"here.");
return NS_ERROR_NOT_IMPLEMENTED;
m_observer = openDialogObserver;
nsresult rv = NS_ERROR_FAILURE;
if (m_dialog)
return NS_ERROR_ALREADY_INITIALIZED;
if (!dialogURL || !*dialogURL)
return NS_ERROR_INVALID_ARG;
if (parent)
{
// Set up window.arguments[0]...
nsCOMPtr<nsISupportsArray> array;
rv = NS_NewISupportsArray(getter_AddRefs(array));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsISupportsInterfacePointer> ifptr =
do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
ifptr->SetData(static_cast<nsIPrintProgress*>(this));
ifptr->SetDataIID(&NS_GET_IID(nsIPrintProgress));
array->AppendElement(ifptr);
array->AppendElement(parameters);
// Open the dialog.
nsCOMPtr<nsIDOMWindow> newWindow;
rv = parent->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL),
NS_LITERAL_STRING("_blank"),
NS_LITERAL_STRING("chrome,titlebar,dependent,centerscreen"),
array, getter_AddRefs(newWindow));
if (NS_SUCCEEDED(rv)) {
*notifyOnOpen = true;
}
}
return rv;
}
/* void closeProgressDialog (in boolean forceClose); */
NS_IMETHODIMP nsPrintProgress::CloseProgressDialog(bool forceClose)
{
MOZ_ASSERT_UNREACHABLE("The nsPrintingPromptService::ShowProgress "
"implementation for OS X returns "
"NS_ERROR_NOT_IMPLEMENTED, so we should never get "
"here.");
return NS_ERROR_NOT_IMPLEMENTED;
m_closeProgress = true;
// XXX Casting bool to nsresult
return OnStateChange(nullptr, nullptr, nsIWebProgressListener::STATE_STOP,
static_cast<nsresult>(forceClose));
}
/* nsIPrompt GetPrompter (); */

View File

@ -6,16 +6,10 @@
#include "nsPrintProgress.h"
#include "nsIBaseWindow.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsISupportsArray.h"
#include "nsIXULWindow.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIComponentManager.h"
#include "nsPIDOMWindow.h"
NS_IMPL_ADDREF(nsPrintProgress)
NS_IMPL_RELEASE(nsPrintProgress)
@ -77,32 +71,12 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(nsIDOMWindow *parent,
array->AppendElement(parameters);
// We will set the opener of the dialog to be the nsIDOMWindow for the
// browser XUL window itself, as opposed to the content. That way, the
// progress window has access to the opener.
nsCOMPtr<nsPIDOMWindow> pParentWindow = do_QueryInterface(parent);
NS_ENSURE_STATE(pParentWindow);
nsCOMPtr<nsIDocShell> docShell = pParentWindow->GetDocShell();
NS_ENSURE_STATE(docShell);
nsCOMPtr<nsIDocShellTreeOwner> owner;
docShell->GetTreeOwner(getter_AddRefs(owner));
nsCOMPtr<nsIXULWindow> ownerXULWindow = do_GetInterface(owner);
nsCOMPtr<nsIDOMWindow> ownerWindow = do_GetInterface(ownerXULWindow);
NS_ENSURE_STATE(ownerWindow);
MOZ_ASSERT_UNREACHABLE("This is a test to see if this can even compile. "
"I don't remember if C++ is this cool.");
// Open the dialog.
nsCOMPtr<nsIDOMWindow> newWindow;
rv = ownerWindow->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL),
NS_LITERAL_STRING("_blank"),
NS_LITERAL_STRING("chrome,titlebar,dependent,centerscreen"),
array, getter_AddRefs(newWindow));
rv = parent->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL),
NS_LITERAL_STRING("_blank"),
NS_LITERAL_STRING("chrome,titlebar,dependent,centerscreen"),
array, getter_AddRefs(newWindow));
}
return rv;

View File

@ -6,16 +6,11 @@
#include "nsPrintProgress.h"
#include "nsIBaseWindow.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsISupportsArray.h"
#include "nsIXULWindow.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsPIDOMWindow.h"
#if 0
NS_IMPL_ADDREF(nsPrintProgress)
@ -105,28 +100,12 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(nsIDOMWindow *parent,
array->AppendElement(parameters);
// We will set the opener of the dialog to be the nsIDOMWindow for the
// browser XUL window itself, as opposed to the content. That way, the
// progress window has access to the opener.
nsCOMPtr<nsPIDOMWindow> pParentWindow = do_QueryInterface(parent);
NS_ENSURE_STATE(pParentWindow);
nsCOMPtr<nsIDocShell> docShell = pParentWindow->GetDocShell();
NS_ENSURE_STATE(docShell);
nsCOMPtr<nsIDocShellTreeOwner> owner;
docShell->GetTreeOwner(getter_AddRefs(owner));
nsCOMPtr<nsIXULWindow> ownerXULWindow = do_GetInterface(owner);
nsCOMPtr<nsIDOMWindow> ownerWindow = do_GetInterface(ownerXULWindow);
NS_ENSURE_STATE(ownerWindow);
// Open the dialog.
nsCOMPtr<nsIDOMWindow> newWindow;
rv = ownerWindow->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL),
NS_LITERAL_STRING("_blank"),
NS_LITERAL_STRING("chrome,titlebar,dependent,centerscreen"),
array, getter_AddRefs(newWindow));
rv = parent->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL),
NS_LITERAL_STRING("_blank"),
NS_LITERAL_STRING("chrome,titlebar,dependent,centerscreen"),
array, getter_AddRefs(newWindow));
}
return rv;