Bug 1347226 - prevent an error thrown by LightWeightThemeManager when a temporary WebExtension theme addon is installed and make sure it's enabled correctly in the Addon Manager. r=mossop

This is done by adding a check to LWTManager that ensures only valid LWTs are
enabled/ disabled there.
The temporary addon install flow never had to deal with addons that would be
disabled by default before. Since WebExtension themes are, we need to explicitly
set `userDisabled = true`.

MozReview-Commit-ID: IkdNAq97cxI

--HG--
extra : rebase_source : 7e78db34cbf20a8ff6e6f1574581ff15fba3a37e
This commit is contained in:
Mike de Boer 2017-04-05 16:27:25 +02:00
parent e6c81765aa
commit 9e0ef2b077
2 changed files with 5 additions and 0 deletions

View File

@ -402,6 +402,9 @@ this.LightweightThemeManager = {
if (id) {
let theme = this.getUsedTheme(id);
// WebExtension themes have an ID, but no LWT wrapper, so bail out here.
if (!theme)
return;
_themeIDBeingEnabled = id;
let wrapper = new AddonWrapper(theme);
if (aPendingRestart) {

View File

@ -4124,6 +4124,8 @@ this.XPIProvider = {
addon.visible = true;
addon.enabled = true;
addon.active = true;
// WebExtension themes are installed as disabled, fix that here.
addon.userDisabled = false;
addon = XPIDatabase.addAddonMetadata(addon, file.persistentDescriptor);