Bug 220215 use the XPCNativeWrapper for Components.lookupMethod r=caillon sr=bz

This commit is contained in:
neil%parkwaycc.co.uk 2006-07-29 05:43:09 +00:00
parent e073b0d18d
commit b90ecb0bb7
3 changed files with 8 additions and 8 deletions

View File

@ -52,6 +52,7 @@
</script>
<script type="application/x-javascript" src="chrome://communicator/content/nsContextMenu.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/XPCNativeWrapper.js"/>
<popupset id="contentAreaContextSet">
<!-- This is a generic context menu for a content area. It contains

View File

@ -45,8 +45,7 @@ function isContentFrame(aFocusedWindow)
if (!aFocusedWindow)
return false;
var focusedTop = Components.lookupMethod(aFocusedWindow, 'top')
.call(aFocusedWindow);
var focusedTop = new XPCNativeWrapper(aFocusedWindow, 'top').top;
return (focusedTop == window.content);
}
@ -69,7 +68,7 @@ function urlSecurityCheck(url, doc)
function getContentFrameURI(aFocusedWindow)
{
var contentFrame = isContentFrame(aFocusedWindow) ? aFocusedWindow : window.content;
return Components.lookupMethod(contentFrame, 'location').call(contentFrame).href;
return new XPCNativeWrapper(contentFrame, "location").location.href;
}
function getReferrer(doc)

View File

@ -479,9 +479,9 @@ nsContextMenu.prototype = {
// initialize popupURL
const IOS = Components.classes["@mozilla.org/network/io-service;1"]
.getService(CI.nsIIOService);
var spec = Components.lookupMethod(window.content.opener, "location")
.call();
this.popupURL = IOS.newURI(spec, null, null);
var opener = new XPCNativeWrapper(window.content, "opener").opener;
var location = new XPCNativeWrapper(opener, "location").location;
this.popupURL = IOS.newURI(location.href, null, null);
// but cancel if it's an unsuitable URL
const PM = Components.classes["@mozilla.org/PopupWindowManager;1"]
@ -675,8 +675,8 @@ nsContextMenu.prototype = {
// Let's try to unescape it using a character set
// in case the address is not ASCII.
try {
var characterSet = Components.lookupMethod(this.target.ownerDocument, "characterSet")
.call(this.target.ownerDocument);
var ownerDocument = new XPCNativeWrapper(this.target, "ownerDocument").ownerDocument;
var characterSet = new XPCNativeWrapper(ownerDocument, "characterSet").characterSet;
const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"]
.getService(Components.interfaces.nsITextToSubURI);
addresses = textToSubURI.unEscapeNonAsciiURI(characterSet, addresses);