summaryrefslogtreecommitdiffstats
path: root/mobile/android/components/PersistentNotificationHandler.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-04-23 15:32:23 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-04-23 15:32:23 -0400
commitabe80cc31d5a40ebed743085011fbcda0c1a9a10 (patch)
treefb3762f06b84745b182af281abb107b95a9fcf01 /mobile/android/components/PersistentNotificationHandler.js
parent63295d0087eb58a6eb34cad324c4c53d1b220491 (diff)
downloadUXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.gz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.lz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.xz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.zip
Issue #1053 - Drop support Android and remove Fennec - Part 1a: Remove mobile/android
Diffstat (limited to 'mobile/android/components/PersistentNotificationHandler.js')
-rw-r--r--mobile/android/components/PersistentNotificationHandler.js78
1 files changed, 0 insertions, 78 deletions
diff --git a/mobile/android/components/PersistentNotificationHandler.js b/mobile/android/components/PersistentNotificationHandler.js
deleted file mode 100644
index 2a3529f5f..000000000
--- a/mobile/android/components/PersistentNotificationHandler.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/* 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";
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Messaging.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, 'Services', // jshint ignore:line
- 'resource://gre/modules/Services.jsm');
-XPCOMUtils.defineLazyServiceGetter(this, "notificationStorage",
- "@mozilla.org/notificationStorage;1",
- "nsINotificationStorage");
-XPCOMUtils.defineLazyServiceGetter(this, "serviceWorkerManager",
- "@mozilla.org/serviceworkers/manager;1",
- "nsIServiceWorkerManager");
-
-function PersistentNotificationHandler() {
-}
-
-PersistentNotificationHandler.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
- classID: Components.ID("{75390fe7-f8a3-423a-b3b1-258d7eabed40}"),
-
- observe(subject, topic, data) {
- if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_DEFAULT) {
- Cu.import("resource://gre/modules/NotificationDB.jsm");
- }
- const persistentInfo = JSON.parse(data);
-
- if (topic === 'persistent-notification-click') {
- notificationStorage.getByID(persistentInfo.origin, persistentInfo.id, {
- handle(id, title, dir, lang, body, tag, icon, data, behavior, serviceWorkerRegistrationScope) {
- serviceWorkerManager.sendNotificationClickEvent(
- persistentInfo.originSuffix,
- serviceWorkerRegistrationScope,
- id,
- title,
- dir,
- lang,
- body,
- tag,
- icon,
- data,
- behavior
- );
- notificationStorage.delete(persistentInfo.origin, persistentInfo.id);
- }
- });
- } else if (topic === 'persistent-notification-close') {
- notificationStorage.getByID(persistentInfo.origin, persistentInfo.id, {
- handle(id, title, dir, lang, body, tag, icon, data, behavior, serviceWorkerRegistrationScope) {
- serviceWorkerManager.sendNotificationCloseEvent(
- persistentInfo.originSuffix,
- serviceWorkerRegistrationScope,
- id,
- title,
- dir,
- lang,
- body,
- tag,
- icon,
- data,
- behavior
- );
- notificationStorage.delete(persistentInfo.origin, persistentInfo.id);
- }
- });
- }
- }
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
- PersistentNotificationHandler
-]);