merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book
2017-08-08 13:18:14 +02:00
106 changed files with 1910 additions and 1638 deletions

View File

@@ -6,7 +6,7 @@
/* global browserActionFor:false, sidebarActionFor:false, pageActionFor:false */
// The ext-* files are imported into the same scopes.
/* import-globals-from ext-utils.js */
/* import-globals-from ext-browser.js */
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");
@@ -31,6 +31,7 @@ Cu.import("resource://gre/modules/ExtensionParent.jsm");
var {
IconDetails,
StartupCache,
} = ExtensionParent;
const POPUP_PRELOAD_TIMEOUT_MS = 200;
@@ -65,7 +66,7 @@ this.browserAction = class extends ExtensionAPI {
return browserActionMap.get(extension);
}
onManifestEntry(entryName) {
async onManifestEntry(entryName) {
let {extension} = this;
let options = extension.manifest.browser_action;
@@ -88,10 +89,6 @@ this.browserAction = class extends ExtensionAPI {
title: options.default_title || extension.name,
badgeText: "",
badgeBackgroundColor: null,
icon: IconDetails.normalize({
path: options.default_icon,
themeIcons: options.theme_icons,
}, extension),
popup: options.default_popup || "",
area: browserAreas[options.default_area || "navbar"],
};
@@ -102,13 +99,25 @@ this.browserAction = class extends ExtensionAPI {
"or not in your browser_action options.");
}
browserActionMap.set(extension, this);
this.defaults.icon = await StartupCache.get(
extension, ["browserAction", "default_icon"],
() => IconDetails.normalize({
path: options.default_icon,
themeIcons: options.theme_icons,
}, extension));
this.iconData.set(
this.defaults.icon,
await StartupCache.get(
extension, ["browserAction", "default_icon_data"],
() => this.getIconData(this.defaults.icon)));
this.tabContext = new TabContext(tab => Object.create(this.defaults),
extension);
EventEmitter.decorate(this);
this.build();
browserActionMap.set(extension, this);
}
onShutdown(reason) {
@@ -130,6 +139,10 @@ this.browserAction = class extends ExtensionAPI {
tooltiptext: this.defaults.title || "",
defaultArea: this.defaults.area,
// Don't attempt to load properties from the built-in widget string
// bundle.
localized: false,
onBeforeCreated: document => {
let view = document.createElementNS(XUL_NS, "panelview");
view.id = this.viewId;