2013-04-25 09:29:31 +04:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
|
|
|
|
|
|
<bindings id="firefoxBrowserBindings"
|
|
|
|
xmlns="http://www.mozilla.org/xbl"
|
|
|
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
|
|
|
|
|
|
<binding id="remote-browser" extends="chrome://global/content/bindings/browser.xml#browser">
|
|
|
|
|
2013-07-19 08:13:35 +04:00
|
|
|
<implementation type="application/javascript" implements="nsIObserver, nsIDOMEventListener, nsIMessageListener, nsIMessageListener">
|
2013-04-25 09:29:31 +04:00
|
|
|
|
2013-07-10 06:45:07 +04:00
|
|
|
<field name="_securityUI">null</field>
|
|
|
|
|
2013-04-25 09:29:31 +04:00
|
|
|
<property name="securityUI"
|
2013-07-10 06:45:07 +04:00
|
|
|
readonly="true">
|
|
|
|
<getter><![CDATA[
|
|
|
|
if (!this._securityUI) {
|
|
|
|
let jsm = "resource://gre/modules/RemoteSecurityUI.jsm";
|
|
|
|
let RemoteSecurityUI = Components.utils.import(jsm, {}).RemoteSecurityUI;
|
|
|
|
this._securityUI = new RemoteSecurityUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
// We want to double-wrap the JS implemented interface, so that QI and instanceof works.
|
|
|
|
var ptr = Cc["@mozilla.org/supports-interface-pointer;1"].
|
|
|
|
createInstance(Ci.nsISupportsInterfacePointer);
|
|
|
|
ptr.data = this._securityUI;
|
|
|
|
return ptr.data.QueryInterface(Ci.nsISecureBrowserUI);
|
|
|
|
]]></getter>
|
|
|
|
</property>
|
2013-04-25 09:29:31 +04:00
|
|
|
|
2013-08-06 20:35:39 +04:00
|
|
|
<field name="_remoteWebNavigation">null</field>
|
|
|
|
|
|
|
|
<property name="webNavigation" readonly="true">
|
|
|
|
<getter>
|
|
|
|
<![CDATA[
|
|
|
|
if (!this._remoteWebNavigation) {
|
|
|
|
let jsm = "resource://gre/modules/RemoteWebNavigation.jsm";
|
2013-09-06 21:10:11 +04:00
|
|
|
let RemoteWebNavigation = Cu.import(jsm, {}).RemoteWebNavigation;
|
2013-08-06 20:35:39 +04:00
|
|
|
this._remoteWebNavigation = new RemoteWebNavigation(this);
|
|
|
|
}
|
|
|
|
return this._remoteWebNavigation;
|
|
|
|
]]>
|
|
|
|
</getter>
|
|
|
|
</property>
|
2013-04-25 09:29:31 +04:00
|
|
|
|
|
|
|
<field name="_remoteWebProgress">null</field>
|
|
|
|
|
|
|
|
<property name="webProgress" readonly="true">
|
2013-07-10 06:45:07 +04:00
|
|
|
<getter>
|
|
|
|
<![CDATA[
|
2013-04-25 09:29:31 +04:00
|
|
|
if (!this._remoteWebProgress) {
|
2013-07-10 06:45:07 +04:00
|
|
|
let jsm = "resource://gre/modules/RemoteWebProgress.jsm";
|
2013-09-06 21:10:11 +04:00
|
|
|
let RemoteWebProgressManager = Cu.import(jsm, {}).RemoteWebProgressManager;
|
|
|
|
this._remoteWebProgress = new RemoteWebProgressManager(this)
|
|
|
|
.topLevelWebProgress;
|
2013-04-25 09:29:31 +04:00
|
|
|
}
|
|
|
|
return this._remoteWebProgress;
|
2013-07-10 06:45:07 +04:00
|
|
|
]]>
|
|
|
|
</getter>
|
2013-04-25 09:29:31 +04:00
|
|
|
</property>
|
|
|
|
|
2013-07-29 19:03:41 +04:00
|
|
|
<field name="_documentURI">null</field>
|
|
|
|
|
|
|
|
<property name="documentURI"
|
|
|
|
onget="return this._documentURI;"
|
|
|
|
readonly="true"/>
|
|
|
|
|
2013-07-27 01:26:35 +04:00
|
|
|
<field name="_contentTitle">""</field>
|
2013-04-25 09:29:39 +04:00
|
|
|
|
|
|
|
<property name="contentTitle"
|
|
|
|
onget="return this._contentTitle"
|
|
|
|
readonly="true"/>
|
|
|
|
|
2013-04-27 19:37:04 +04:00
|
|
|
<field name="_characterSet">null</field>
|
|
|
|
|
|
|
|
<property name="characterSet"
|
|
|
|
onget="return this._characterSet"
|
|
|
|
readonly="true"/>
|
|
|
|
|
2013-07-17 17:27:49 +04:00
|
|
|
<field name="_contentWindow">null</field>
|
|
|
|
|
|
|
|
<property name="contentWindow"
|
|
|
|
onget="return this._contentWindow"
|
|
|
|
readonly="true"/>
|
|
|
|
|
|
|
|
<property name="contentDocument"
|
|
|
|
onget="return this.contentWindow ? this.contentWindow.document : null"
|
|
|
|
readonly="true"/>
|
|
|
|
|
2013-07-29 19:03:41 +04:00
|
|
|
<field name="_imageDocument">null</field>
|
|
|
|
|
|
|
|
<property name="imageDocument"
|
|
|
|
onget="return this._imageDocument"
|
|
|
|
readonly="true"/>
|
|
|
|
|
2013-04-25 09:29:31 +04:00
|
|
|
<constructor>
|
|
|
|
<![CDATA[
|
2013-04-25 09:29:39 +04:00
|
|
|
this.messageManager.addMessageListener("DOMTitleChanged", this);
|
2013-07-29 19:03:41 +04:00
|
|
|
this.messageManager.addMessageListener("ImageDocumentLoaded", this);
|
2013-04-25 09:29:31 +04:00
|
|
|
this.messageManager.loadFrameScript("chrome://global/content/browser-child.js", true);
|
2013-08-26 05:34:23 +04:00
|
|
|
|
|
|
|
if (this.hasAttribute("selectpopup")) {
|
|
|
|
this.messageManager.addMessageListener("Forms:ShowDropDown", this);
|
|
|
|
this.messageManager.addMessageListener("Forms:HideDropDown", this);
|
|
|
|
this.messageManager.loadFrameScript("chrome://global/content/select-child.js", true);
|
|
|
|
}
|
|
|
|
|
2013-08-21 21:24:53 +04:00
|
|
|
let jsm = "resource://gre/modules/RemoteController.jsm";
|
|
|
|
let RemoteController = Components.utils.import(jsm, {}).RemoteController;
|
|
|
|
this._controller = new RemoteController(this);
|
|
|
|
this.controllers.appendController(this._controller);
|
2013-08-29 08:43:00 +04:00
|
|
|
|
|
|
|
jsm = "resource://gre/modules/RemoteAddonsParent.jsm";
|
|
|
|
let RemoteAddonsParent = Components.utils.import(jsm, {}).RemoteAddonsParent;
|
|
|
|
RemoteAddonsParent.init();
|
2013-04-25 09:29:31 +04:00
|
|
|
]]>
|
|
|
|
</constructor>
|
|
|
|
|
2013-04-25 09:29:39 +04:00
|
|
|
<method name="receiveMessage">
|
|
|
|
<parameter name="aMessage"/>
|
|
|
|
<body><![CDATA[
|
2013-08-26 05:34:23 +04:00
|
|
|
let data = aMessage.data;
|
2013-04-25 09:29:39 +04:00
|
|
|
switch (aMessage.name) {
|
|
|
|
case "DOMTitleChanged":
|
2013-08-26 05:34:23 +04:00
|
|
|
this._contentTitle = data.title;
|
2013-04-25 09:29:39 +04:00
|
|
|
break;
|
2013-07-29 19:03:41 +04:00
|
|
|
case "ImageDocumentLoaded":
|
|
|
|
this._imageDocument = {
|
2013-08-26 05:34:23 +04:00
|
|
|
width: data.width,
|
|
|
|
height: data.height
|
2013-07-29 19:03:41 +04:00
|
|
|
};
|
|
|
|
break;
|
2013-08-26 05:34:23 +04:00
|
|
|
|
|
|
|
case "Forms:ShowDropDown": {
|
|
|
|
Cu.import("resource://gre/modules/SelectParentHelper.jsm");
|
|
|
|
let dropdown = document.getElementById(this.getAttribute("selectpopup"));
|
|
|
|
SelectParentHelper.populate(dropdown, data.options, data.selectedIndex);
|
|
|
|
SelectParentHelper.open(this, dropdown, data.rect);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case "Forms:HideDropDown": {
|
|
|
|
Cu.import("resource://gre/modules/SelectParentHelper.jsm");
|
|
|
|
let dropdown = document.getElementById(this.getAttribute("selectpopup"));
|
|
|
|
SelectParentHelper.hide(dropdown);
|
|
|
|
}
|
2013-04-25 09:29:39 +04:00
|
|
|
}
|
|
|
|
]]></body>
|
|
|
|
</method>
|
|
|
|
|
2013-04-25 09:29:31 +04:00
|
|
|
</implementation>
|
|
|
|
|
|
|
|
</binding>
|
|
|
|
|
|
|
|
</bindings>
|