Files
tubestation/browser/components/about/AboutPrivateBrowsingHandler.jsm
Johann Hofmann 4f70cfcab3 Bug 1476218 - Part 1 - Update Tracking Protection section in the identity popup for Content Blocking. r=nhnt11
This commit switches the identity popup to use "Content Blocking" as a top-level section
instead of Tracking Protection, which is now demoted to a category of Content Blocking.

To keep this change halfway reviewable, I avoided renaming variables, classNames, ids, etc.
that use the term trackingProtection if they were otherwise unaffected by this patch. There
will be other patches that can do this in the future

Differential Revision: https://phabricator.services.mozilla.com/D2775
2018-08-06 12:43:59 +02:00

46 lines
1.2 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["AboutPrivateBrowsingHandler"];
ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm");
var AboutPrivateBrowsingHandler = {
_topics: [
"DontShowIntroPanelAgain",
"OpenPrivateWindow",
],
init() {
this.pageListener = new RemotePages("about:privatebrowsing");
for (let topic of this._topics) {
this.pageListener.addMessageListener(topic, this.receiveMessage.bind(this));
}
},
uninit() {
for (let topic of this._topics) {
this.pageListener.removeMessageListener(topic);
}
this.pageListener.destroy();
},
receiveMessage(aMessage) {
switch (aMessage.name) {
case "OpenPrivateWindow": {
let win = aMessage.target.browser.ownerGlobal;
win.OpenBrowserWindow({private: true});
break;
}
case "DontShowIntroPanelAgain": {
let win = aMessage.target.browser.ownerGlobal;
win.ContentBlocking.dontShowIntroPanelAgain();
break;
}
}
},
};