2012-05-08 20:20:35 +04:00
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2012-07-20 10:48:27 +04:00
|
|
|
let { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
2012-05-11 11:47:40 +04:00
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
2012-06-07 18:43:23 +04:00
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
2012-07-20 10:48:27 +04:00
|
|
|
Cu.import("resource://gre/modules/Geometry.jsm");
|
2012-05-23 18:15:31 +04:00
|
|
|
|
2012-05-08 20:20:35 +04:00
|
|
|
function debug(msg) {
|
2012-05-09 03:17:10 +04:00
|
|
|
//dump("BrowserElementChild - " + msg + "\n");
|
2012-05-08 20:20:35 +04:00
|
|
|
}
|
|
|
|
|
2013-02-08 09:10:01 +04:00
|
|
|
// NB: this must happen before we process any messages from
|
|
|
|
// mozbrowser API clients.
|
|
|
|
docShell.isActive = true;
|
2012-12-06 21:03:27 +04:00
|
|
|
|
2013-02-08 09:10:01 +04:00
|
|
|
let infos = sendSyncMessage('browser-element-api:call',
|
|
|
|
{ 'msg_name': 'hello' })[0];
|
|
|
|
docShell.QueryInterface(Ci.nsIDocShellTreeItem).name = infos.name;
|
|
|
|
docShell.setFullscreenAllowed(infos.fullscreenAllowed);
|
2012-12-06 21:03:27 +04:00
|
|
|
|
|
|
|
|
2013-02-08 09:10:01 +04:00
|
|
|
if (!('BrowserElementIsPreloaded' in this)) {
|
|
|
|
// This is a produc-specific file that's sometimes unavailable.
|
|
|
|
try {
|
|
|
|
Services.scriptloader.loadSubScript("chrome://browser/content/forms.js");
|
|
|
|
} catch (e) {
|
2012-09-27 02:03:25 +04:00
|
|
|
}
|
2013-02-08 09:10:01 +04:00
|
|
|
Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementPanning.js");
|
|
|
|
Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementChildPreload.js");
|
|
|
|
}
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2013-02-08 09:10:01 +04:00
|
|
|
var BrowserElementIsReady = true;
|