2012-05-08 09:20:35 -07: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-19 23:48:27 -07:00
|
|
|
let { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
2012-05-11 00:47:40 -07:00
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
2012-06-07 07:43:23 -07:00
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
2012-07-19 23:48:27 -07:00
|
|
|
Cu.import("resource://gre/modules/Geometry.jsm");
|
2012-05-23 07:15:31 -07:00
|
|
|
|
2012-05-08 09:20:35 -07:00
|
|
|
function debug(msg) {
|
2012-05-08 16:17:10 -07:00
|
|
|
//dump("BrowserElementChild - " + msg + "\n");
|
2012-05-08 09:20:35 -07:00
|
|
|
}
|
|
|
|
|
2013-02-07 21:10:01 -08:00
|
|
|
// NB: this must happen before we process any messages from
|
|
|
|
// mozbrowser API clients.
|
|
|
|
docShell.isActive = true;
|
2012-12-06 09:03:27 -08:00
|
|
|
|
2013-02-07 21:10:01 -08: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 09:03:27 -08:00
|
|
|
|
|
|
|
|
2013-02-07 21:10:01 -08: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-26 15:03:25 -07:00
|
|
|
}
|
2013-02-07 21:10:01 -08:00
|
|
|
Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementPanning.js");
|
|
|
|
Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementChildPreload.js");
|
|
|
|
}
|
2012-07-19 23:48:27 -07:00
|
|
|
|
2013-02-07 21:10:01 -08:00
|
|
|
var BrowserElementIsReady = true;
|