Bug 822017 - Remove the global PB specific code from the testpilot extension; r=dao

--HG--
rename : browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js => browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js.in
rename : browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/tasks.js => browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/tasks.js.in
This commit is contained in:
Ehsan Akhgari 2013-01-04 13:09:11 -05:00
Родитель a127013839
Коммит afbf0d1b25
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -172,8 +172,10 @@ let TestPilotSetup = {
"testpilot:task:dataAutoSubmitted", this._onTaskDataAutoSubmitted, self);
// Set up observation for application shutdown.
this._obs.add("quit-application", this.globalShutdown, self);
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
// Set up observation for enter/exit private browsing:
this._obs.add("private-browsing", this.onPrivateBrowsingMode, self);
#endif
// Set up timers to remind user x minutes after startup
// and once per day thereafter. Use nsITimer so it doesn't belong to
@ -243,7 +245,9 @@ let TestPilotSetup = {
this._obs.remove(
"testpilot:task:dataAutoSubmitted", this._onTaskDataAutoSubmitted, self);
this._obs.remove("quit-application", this.globalShutdown, self);
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
this._obs.remove("private-browsing", this.onPrivateBrowsingMode, self);
#endif
this._loader.unload();
this._shortTimer.cancel();
this._longTimer.cancel();
@ -257,6 +261,7 @@ let TestPilotSetup = {
return wm.getMostRecentWindow("navigator:browser");
},
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
onPrivateBrowsingMode: function TPS_onPrivateBrowsingMode(topic, data) {
for (let i = 0; i < this.taskList.length; i++) {
if (data == "enter") {
@ -266,6 +271,7 @@ let TestPilotSetup = {
}
}
},
#endif
onWindowUnload: function TPS__onWindowRegistered(window) {
this._logger.trace("Called TestPilotSetup.onWindow unload!");

Просмотреть файл

@ -162,11 +162,13 @@ var TestPilotTask = {
// Called by extension core when Firefox is shutting down.
},
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
onEnterPrivateBrowsing: function TestPilotTask_onEnterPrivate() {
},
onExitPrivateBrowsing: function TestPilotTask_onExitPrivate() {
},
#endif
onNewWindow: function TestPilotTask_onNewWindow(window) {
},
@ -532,6 +534,7 @@ TestPilotExperiment.prototype = {
}
},
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
onEnterPrivateBrowsing: function TestPilotExperiment_onEnterPrivate() {
this._logger.trace("Task is entering private browsing.");
if (this.experimentIsRunning()) {
@ -553,6 +556,7 @@ TestPilotExperiment.prototype = {
}
}
},
#endif
getStudyMetadata: function TestPilotExperiment_getStudyMetadata() {
try {