1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/telemetry/TelemetryStartup.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,28 @@ 1.4 +/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +"use strict"; 1.10 + 1.11 +const Cu = Components.utils; 1.12 + 1.13 +Cu.import("resource://gre/modules/TelemetryPing.jsm", this); 1.14 +Cu.import("resource://gre/modules/XPCOMUtils.jsm", this) 1.15 + 1.16 +/** 1.17 + * TelemetryStartup is needed to forward the "profile-after-change" notification 1.18 + * to TelemetryPing.jsm. 1.19 + */ 1.20 +function TelemetryStartup() { 1.21 +} 1.22 + 1.23 +TelemetryStartup.prototype.classID = Components.ID("{117b219f-92fe-4bd2-a21b-95a342a9d474}"); 1.24 +TelemetryStartup.prototype.QueryInterface = XPCOMUtils.generateQI([Components.interfaces.nsIObserver]) 1.25 +TelemetryStartup.prototype.observe = function(aSubject, aTopic, aData){ 1.26 + if (aTopic == "profile-after-change") { 1.27 + TelemetryPing.observe(null, "profile-after-change", null); 1.28 + } 1.29 +} 1.30 + 1.31 +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryStartup]);