1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 ChromeUtils.defineESModuleGetters(lazy, {
8 AboutPages: "resource://normandy-content/AboutPages.sys.mjs",
11 export class ShieldFrameParent extends JSWindowActorParent {
12 async receiveMessage(msg) {
13 let { aboutStudies } = lazy.AboutPages;
15 case "Shield:AddToWeakSet":
16 aboutStudies.addToWeakSet(this.browsingContext);
18 case "Shield:RemoveFromWeakSet":
19 aboutStudies.removeFromWeakSet(this.browsingContext);
21 case "Shield:GetAddonStudyList":
22 return aboutStudies.getAddonStudyList();
23 case "Shield:GetPreferenceStudyList":
24 return aboutStudies.getPreferenceStudyList();
25 case "Shield:GetMessagingSystemList":
26 return aboutStudies.getMessagingSystemList();
27 case "Shield:RemoveAddonStudy":
28 aboutStudies.removeAddonStudy(msg.data.recipeId, msg.data.reason);
30 case "Shield:RemovePreferenceStudy":
31 aboutStudies.removePreferenceStudy(
32 msg.data.experimentName,
36 case "Shield:RemoveMessagingSystemExperiment":
37 aboutStudies.removeMessagingSystemExperiment(
42 case "Shield:OpenDataPreferences":
43 aboutStudies.openDataPreferences();
45 case "Shield:GetStudiesEnabled":
46 return aboutStudies.getStudiesEnabled();
47 case "Shield:ExperimentOptIn":
48 return aboutStudies.optInToExperiment(msg.data);