mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 13:45:46 +00:00
Bug 861495 - Part 1: Add nsIWindowMediator.getOuterWindowWithId and warn on nsIDOMWindowUtils.getOuterWindowWithId use. r=bz
This commit is contained in:
parent
51905450be
commit
1b1dd2fcc3
@ -71,6 +71,7 @@
|
|||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "nsViewportInfo.h"
|
#include "nsViewportInfo.h"
|
||||||
#include "nsIFormControl.h"
|
#include "nsIFormControl.h"
|
||||||
|
#include "nsIScriptError.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
@ -2514,6 +2515,13 @@ nsDOMWindowUtils::GetOuterWindowWithId(uint64_t aWindowID,
|
|||||||
return NS_ERROR_DOM_SECURITY_ERR;
|
return NS_ERROR_DOM_SECURITY_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX This method is deprecated. See bug 865664.
|
||||||
|
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||||
|
"DOM",
|
||||||
|
nsContentUtils::GetDocumentFromCaller(),
|
||||||
|
nsContentUtils::eDOM_PROPERTIES,
|
||||||
|
"GetWindowWithOuterIdWarning");
|
||||||
|
|
||||||
*aWindow = nsGlobalWindow::GetOuterWindowWithId(aWindowID);
|
*aWindow = nsGlobalWindow::GetOuterWindowWithId(aWindowID);
|
||||||
NS_IF_ADDREF(*aWindow);
|
NS_IF_ADDREF(*aWindow);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1111,6 +1111,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the outer window with the given ID, if any. Can return null.
|
* Return the outer window with the given ID, if any. Can return null.
|
||||||
|
* @deprecated Use nsIWindowMediator.getOuterWindowWithId. See bug 865664.
|
||||||
*/
|
*/
|
||||||
nsIDOMWindow getOuterWindowWithId(in unsigned long long aOuterWindowID);
|
nsIDOMWindow getOuterWindowWithId(in unsigned long long aOuterWindowID);
|
||||||
|
|
||||||
|
@ -133,3 +133,5 @@ NodeIteratorDetachWarning=Calling detach() on a NodeIterator no longer has an ef
|
|||||||
MozAudioDataWarning=The Mozilla Audio Data API is deprecated. Please use the Web Audio API instead.
|
MozAudioDataWarning=The Mozilla Audio Data API is deprecated. Please use the Web Audio API instead.
|
||||||
# LOCALIZATION NOTE: Do not translate "LenientThis" and "this"
|
# LOCALIZATION NOTE: Do not translate "LenientThis" and "this"
|
||||||
LenientThisWarning=Ignoring get or set of property that has [LenientThis] because the "this" object is incorrect.
|
LenientThisWarning=Ignoring get or set of property that has [LenientThis] because the "this" object is incorrect.
|
||||||
|
# LOCALIZATION NOTE: Do not translate "nsIDOMWindowUtils", "getWindowWithOuterId", or "nsIWindowMediator"
|
||||||
|
GetWindowWithOuterIdWarning=Use of nsIDOMWindowUtils.getOuterWindowWithId() is deprecated. Instead, use the nsIWindowMediator method of the same name.
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
%{C++
|
%{C++
|
||||||
#define NS_WINDOWMEDIATOR_CID \
|
#define NS_WINDOWMEDIATOR_CID \
|
||||||
{ 0x292e17c8, 0xccc1, 0x42e1, \
|
{ 0x808b2fa3, 0x8a02, 0x49ca, \
|
||||||
{ 0xac, 0x8b, 0xaf, 0x61, 0x7d, 0x54, 0x13, 0xb1 } }
|
{ 0x91, 0x04, 0x5f, 0x77, 0x29, 0x9e, 0x09, 0x0b } }
|
||||||
|
|
||||||
#define NS_WINDOWMEDIATOR_CONTRACTID \
|
#define NS_WINDOWMEDIATOR_CONTRACTID \
|
||||||
"@mozilla.org/appshell/window-mediator;1"
|
"@mozilla.org/appshell/window-mediator;1"
|
||||||
@ -20,7 +20,7 @@ interface nsIWidget;
|
|||||||
interface nsIDOMWindow;
|
interface nsIDOMWindow;
|
||||||
interface nsIWindowMediatorListener;
|
interface nsIWindowMediatorListener;
|
||||||
|
|
||||||
[scriptable, uuid(292e17c8-ccc1-42e1-ac8b-af617d5413b1)]
|
[scriptable, uuid(808b2fa3-8a02-49ca-9104-5f77299e090b)]
|
||||||
interface nsIWindowMediator: nsISupports
|
interface nsIWindowMediator: nsISupports
|
||||||
{
|
{
|
||||||
/** Return an enumerator which iterates over all windows of type aWindowType
|
/** Return an enumerator which iterates over all windows of type aWindowType
|
||||||
@ -69,6 +69,11 @@ interface nsIWindowMediator: nsISupports
|
|||||||
*/
|
*/
|
||||||
nsIDOMWindow getMostRecentWindow(in wstring aWindowType);
|
nsIDOMWindow getMostRecentWindow(in wstring aWindowType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the outer window with the given ID, if any. Can return null.
|
||||||
|
*/
|
||||||
|
nsIDOMWindow getOuterWindowWithId(in unsigned long long aOuterWindowID);
|
||||||
|
|
||||||
/** Add the window to the list of known windows. Listeners (see
|
/** Add the window to the list of known windows. Listeners (see
|
||||||
* addListener) will be notified through their onOpenWindow method.
|
* addListener) will be notified through their onOpenWindow method.
|
||||||
* @param aWindow the window to add
|
* @param aWindow the window to add
|
||||||
|
@ -28,5 +28,7 @@ CPPSRCS = \
|
|||||||
nsAppShellFactory.cpp \
|
nsAppShellFactory.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
LOCAL_INCLUDES += -I$(topsrcdir)/dom/base
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "nsWindowMediator.h"
|
#include "nsWindowMediator.h"
|
||||||
#include "nsIWindowMediatorListener.h"
|
#include "nsIWindowMediatorListener.h"
|
||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
|
#include "nsGlobalWindow.h"
|
||||||
|
|
||||||
#include "nsIDocShell.h"
|
#include "nsIDocShell.h"
|
||||||
#include "nsIInterfaceRequestor.h"
|
#include "nsIInterfaceRequestor.h"
|
||||||
@ -320,6 +321,15 @@ nsWindowMediator::MostRecentWindowInfo(const PRUnichar* inType)
|
|||||||
return foundInfo;
|
return foundInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsWindowMediator::GetOuterWindowWithId(uint64_t aWindowID,
|
||||||
|
nsIDOMWindow** aWindow)
|
||||||
|
{
|
||||||
|
*aWindow = nsGlobalWindow::GetOuterWindowWithId(aWindowID);
|
||||||
|
NS_IF_ADDREF(*aWindow);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsWindowMediator::UpdateWindowTimeStamp(nsIXULWindow* inWindow)
|
nsWindowMediator::UpdateWindowTimeStamp(nsIXULWindow* inWindow)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user