toolkit/components/telemetry/TelemetryStartup.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:1ee0044882f0
1 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 "use strict";
7
8 const Cu = Components.utils;
9
10 Cu.import("resource://gre/modules/TelemetryPing.jsm", this);
11 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this)
12
13 /**
14 * TelemetryStartup is needed to forward the "profile-after-change" notification
15 * to TelemetryPing.jsm.
16 */
17 function TelemetryStartup() {
18 }
19
20 TelemetryStartup.prototype.classID = Components.ID("{117b219f-92fe-4bd2-a21b-95a342a9d474}");
21 TelemetryStartup.prototype.QueryInterface = XPCOMUtils.generateQI([Components.interfaces.nsIObserver])
22 TelemetryStartup.prototype.observe = function(aSubject, aTopic, aData){
23 if (aTopic == "profile-after-change") {
24 TelemetryPing.observe(null, "profile-after-change", null);
25 }
26 }
27
28 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryStartup]);

mercurial