Bug 648715 - "Version/Channel compatibility for Firefox 5 beta" [r=mark.finkle]

This commit is contained in:
Jono X 2011-04-09 23:33:00 -04:00
parent 8c66b9ae68
commit fb273c89ba
3 changed files with 12 additions and 16 deletions

View File

@ -4,7 +4,7 @@
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>testpilot@labs.mozilla.com</em:id>
<em:version>1.0.6</em:version>
<em:version>1.0.9</em:version>
<em:type>2</em:type>
<!-- Target Application this extension can install into,
@ -13,7 +13,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.5</em:minVersion>
<em:maxVersion>4.0.*</em:maxVersion>
<em:maxVersion>5.0</em:maxVersion>
</Description>
</em:targetApplication>

View File

@ -108,8 +108,9 @@ var TestPilotUIBuilder = {
},
isBetaChannel: function() {
// Nightly channel is treated the same as default channel.
return (this._prefs.getCharPref(UPDATE_CHANNEL_PREF) == "beta");
// Beta and aurora channels use feedback interface; nightly and release channels don't.
let channel = this._prefs.getCharPref(UPDATE_CHANNEL_PREF);
return (channel == "beta") || (channel == "betatest") || (channel == "aurora");
},
appVersionIsFinal: function() {

View File

@ -185,15 +185,10 @@ let TestPilotSetup = {
return this.__obs;
},
_isFfx4BetaVersion: function TPS__isFfx4BetaVersion() {
let result = Cc["@mozilla.org/xpcom/version-comparator;1"]
.getService(Ci.nsIVersionComparator)
.compare("3.7a1pre", this._application.version);
if (result < 0) {
return true;
} else {
return false;
}
_isBetaChannel: function TPS__isBetaChannel() {
// Beta and aurora channels use feedback interface; nightly and release channels don't.
let channel = this._prefs.getValue(UPDATE_CHANNEL_PREF, "");
return (channel == "beta") || (channel == "betatest") || (channel == "aurora");
},
_setPrefDefaultsForVersion: function TPS__setPrefDefaultsForVersion() {
@ -205,7 +200,7 @@ let TestPilotSetup = {
let prefBranch = ps.getDefaultBranch("");
/* note we're setting default values, not current values -- these
* get overridden by any user set values. */
if (this._isFfx4BetaVersion()) {
if (this._isBetaChannel()) {
prefBranch.setBoolPref(POPUP_SHOW_ON_NEW, true);
prefBranch.setIntPref(POPUP_CHECK_INTERVAL, 600000);
} else {
@ -262,7 +257,7 @@ let TestPilotSetup = {
let currVersion = self._prefs.getValue(VERSION_PREF, "firstrun");
if (currVersion != self.version) {
if(!self._isFfx4BetaVersion()) {
if(!self._isBetaChannel()) {
self._prefs.setValue(VERSION_PREF, self.version);
let browser = self._getFrontBrowserWindow().getBrowser();
let url = self._prefs.getValue(FIRST_RUN_PREF, "");
@ -386,7 +381,7 @@ let TestPilotSetup = {
let popup = doc.getElementById("pilot-notification-popup");
let anchor;
if (this._isFfx4BetaVersion()) {
if (this._isBetaChannel()) {
/* If we're in the Ffx4Beta version, popups come down from feedback
* button, but if we're in the standalone extension version, they
* come up from status bar icon. */