Bug 1483591 - Treat built-in webextension page actions as built-in r=adw

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Striemer 2018-09-21 21:50:26 +00:00
Родитель 415fb653ea
Коммит 2b0aaa8c2d
2 изменённых файлов: 10 добавлений и 6 удалений

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

@ -833,7 +833,7 @@ var BrowserPageActions = {
}
let state;
if (this._contextAction._isBuiltIn) {
if (this._contextAction._isMozillaAction) {
state =
this._contextAction.pinnedToUrlbar ?
"builtInPinned" :

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

@ -223,9 +223,10 @@ var PageActions = {
} else if (action.__transient) {
// A transient action.
this._transientActions.push(action);
} else if (gBuiltInActions.find(a => a.id == action.id)) {
// A built-in action. These are always added on init before all other
// actions, one after the other, so just push onto the array.
} else if (action._isBuiltIn) {
// A built-in action. These are mostly added on init before all other
// actions, one after the other. Extension actions load later and should
// be at the end, so just push onto the array.
this._builtInActions.push(action);
} else {
// A non-built-in action, like a non-bundled extension potentially.
@ -330,7 +331,7 @@ var PageActions = {
let histogramID = "FX_PAGE_ACTION_" + type.toUpperCase();
try {
let histogram = Services.telemetry.getHistogramById(histogramID);
if (action._isBuiltIn) {
if (action._isMozillaAction) {
histogram.add(action.labelForHistogram);
} else {
histogram.add("other");
@ -1039,10 +1040,13 @@ Action.prototype = {
let builtInIDs = [
"pocket",
"screenshots_mozilla_org",
"webcompat-reporter-button",
].concat(gBuiltInActions.filter(a => !a.__isSeparator).map(a => a.id));
return builtInIDs.includes(this.id);
},
get _isMozillaAction() {
return this._isBuiltIn || this.id == "webcompat-reporter-button";
},
};
this.PageActions.Action = Action;