Bug 1600742 - Use WebExtensionPolicy instead of AddonManager for actions. r=snorp

Differential Revision: https://phabricator.services.mozilla.com/D56791

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Agi Sferro 2019-12-17 23:23:54 +00:00
Родитель f8d68e46e1
Коммит 14f0d7f3b6
1 изменённых файлов: 11 добавлений и 8 удалений

Просмотреть файл

@ -448,12 +448,12 @@ var GeckoViewWebExtension = {
},
async browserActionClick(aId) {
const extension = await this.extensionById(aId);
if (!extension) {
const policy = WebExtensionPolicy.getByID(aId);
if (!policy) {
return;
}
const browserAction = this.browserActions.get(extension);
const browserAction = this.browserActions.get(policy.extension);
if (!browserAction) {
return;
}
@ -462,12 +462,12 @@ var GeckoViewWebExtension = {
},
async pageActionClick(aId) {
const extension = await this.extensionById(aId);
if (!extension) {
const policy = WebExtensionPolicy.getByID(aId);
if (!policy) {
return;
}
const pageAction = this.pageActions.get(extension);
const pageAction = this.pageActions.get(policy.extension);
if (!pageAction) {
return;
}
@ -476,11 +476,14 @@ var GeckoViewWebExtension = {
},
async actionDelegateAttached(aId) {
const extension = await this.extensionById(aId);
if (!extension) {
const policy = WebExtensionPolicy.getByID(aId);
if (!policy) {
debug`Could not find extension with id=${aId}`;
return;
}
const { extension } = policy;
const browserAction = this.browserActions.get(extension);
if (browserAction) {
// Send information about this action to the delegate