зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1267891 - toolkit changes - Remove license capability from application update. r=mhowell
This commit is contained in:
Родитель
db1d6b71a1
Коммит
04de3f2414
|
@ -36,17 +36,6 @@
|
|||
<!ENTITY evangelism.desc "It is strongly recommended that you apply this
|
||||
update for &brandShortName; as soon as possible.">
|
||||
|
||||
<!ENTITY license.instructions "If you agree to the terms of this agreement, click I Agree
|
||||
below to continue installing this update.">
|
||||
|
||||
<!ENTITY license.titleText "Software License Agreement">
|
||||
<!ENTITY license.introText "Terms and conditions for using this software.">
|
||||
<!ENTITY license.instructionText "Please read the following license agreement. Use the scroll bar to view the rest of this agreement.">
|
||||
<!ENTITY license.accept "I accept the terms of the License Agreement">
|
||||
<!ENTITY license.accept.accesskey "c">
|
||||
<!ENTITY license.decline "I do NOT accept the terms of the License Agreement">
|
||||
<!ENTITY license.decline.accesskey "T">
|
||||
|
||||
<!ENTITY downloadPage.title "Downloading &brandShortName;">
|
||||
<!ENTITY downloading.intro "Downloading the update…">
|
||||
<!ENTITY connecting.label "Connecting to the update server…">
|
||||
|
|
|
@ -11,7 +11,6 @@ updateFullName=%S (%S)
|
|||
# where update version from the update xml
|
||||
# example: MyApplication 10.0.5
|
||||
updateName=%S %S
|
||||
licenseContentDownloading=Getting license for %S %S…
|
||||
updateMoreInfoContentDownloading=Getting more details about %S %S…
|
||||
|
||||
# LOCALIZATION NOTE: When present
|
||||
|
@ -27,7 +26,6 @@ updateType_minor=Security Update
|
|||
|
||||
# LOCALIZATION NOTE: When present %S is brandShortName
|
||||
verificationError=%S could not confirm the integrity of the update package.
|
||||
licenseContentNotFound=The license file for this version could not be found. Please visit the %S homepage for more information.
|
||||
updateMoreInfoContentNotFound=Additional details about this version could not be found. Please visit the %S homepage for more information.
|
||||
resumePausedAfterCloseTitle=Software Update
|
||||
resumePausedAfterCloseMsg=You have paused downloading this update. Do you want to download the update in the background while you continue to use %S?
|
||||
|
|
|
@ -329,7 +329,6 @@ this.AUSTLMY = {
|
|||
unsupported: 6,
|
||||
updatesfoundbasic: 8,
|
||||
updatesfoundbillboard: 9,
|
||||
license: 10,
|
||||
downloading: 12,
|
||||
errors: 13,
|
||||
errorextra: 14,
|
||||
|
|
|
@ -26,7 +26,7 @@ updateheader {
|
|||
-moz-box-orient: horizontal;
|
||||
}
|
||||
|
||||
/* Remote content displayed in the billboard and license pages. */
|
||||
/* Remote content displayed in the billboard page. */
|
||||
remotecontent {
|
||||
-moz-binding: url("chrome://mozapps/content/update/updates.xml#remotecontent");
|
||||
display: -moz-deck;
|
||||
|
|
|
@ -441,10 +441,6 @@ var gUpdates = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.update.licenseURL) {
|
||||
this.wiz.getPageById(this.updatesFoundPageId).setAttribute("next", "license");
|
||||
}
|
||||
|
||||
aCallback(this.updatesFoundPageId);
|
||||
return;
|
||||
}
|
||||
|
@ -580,12 +576,6 @@ var gCheckingPage = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (gUpdates.update.licenseURL) {
|
||||
// gUpdates.updatesFoundPageId returns the pageid and not the
|
||||
// element's id so use the wizard's getPageById method.
|
||||
gUpdates.wiz.getPageById(gUpdates.updatesFoundPageId).setAttribute("next", "license");
|
||||
}
|
||||
|
||||
gUpdates.wiz.goTo(gUpdates.updatesFoundPageId);
|
||||
return;
|
||||
}
|
||||
|
@ -880,127 +870,6 @@ var gUpdatesFoundBillboardPage = {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The page which shows the user a license associated with an update. The
|
||||
* user must agree to the terms of the license before continuing to install
|
||||
* the update.
|
||||
*/
|
||||
var gLicensePage = {
|
||||
/**
|
||||
* If the license url has been previously loaded
|
||||
*/
|
||||
_licenseLoaded: false,
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
onPageShow: function() {
|
||||
gUpdates.setButtons("backButton", null, "acceptTermsButton", false);
|
||||
|
||||
var licenseContent = document.getElementById("licenseContent");
|
||||
if (this._licenseLoaded || licenseContent.getAttribute("state") == "error") {
|
||||
this.onAcceptDeclineRadio();
|
||||
var licenseGroup = document.getElementById("acceptDeclineLicense");
|
||||
licenseGroup.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
gUpdates.wiz.canAdvance = false;
|
||||
|
||||
// Disable the license radiogroup until the EULA has been downloaded
|
||||
document.getElementById("acceptDeclineLicense").disabled = true;
|
||||
gUpdates.update.setProperty("licenseAccepted", "false");
|
||||
|
||||
licenseContent.addEventListener("load", gLicensePage.onLicenseLoad, false);
|
||||
// The update_name and update_version need to be set before url so the ui
|
||||
// can display the formatted "Download..." string when attempting to
|
||||
// download the url.
|
||||
licenseContent.update_name = gUpdates.brandName;
|
||||
licenseContent.update_version = gUpdates.update.displayVersion;
|
||||
licenseContent.url = gUpdates.update.licenseURL;
|
||||
},
|
||||
|
||||
/**
|
||||
* When the license document has loaded
|
||||
*/
|
||||
onLicenseLoad: function(aEvent) {
|
||||
var licenseContent = document.getElementById("licenseContent");
|
||||
// Disable or enable the radiogroup based on the state attribute of
|
||||
// licenseContent.
|
||||
// Note: may be called multiple times due to multiple onLoad events.
|
||||
var state = licenseContent.getAttribute("state");
|
||||
if (state == "loading" || aEvent.originalTarget != licenseContent)
|
||||
return;
|
||||
|
||||
licenseContent.removeEventListener("load", gLicensePage.onLicenseLoad, false);
|
||||
|
||||
if (state == "error") {
|
||||
gUpdates.wiz.goTo("manualUpdate");
|
||||
return;
|
||||
}
|
||||
|
||||
gLicensePage._licenseLoaded = true;
|
||||
document.getElementById("acceptDeclineLicense").disabled = false;
|
||||
gUpdates.wiz.getButton("extra1").disabled = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* When the user changes the state of the accept / decline radio group
|
||||
*/
|
||||
onAcceptDeclineRadio: function() {
|
||||
// Return early if this page hasn't been loaded (bug 405257). This event is
|
||||
// fired during the construction of the wizard before gUpdates has received
|
||||
// its onload event (bug 452389).
|
||||
if (!this._licenseLoaded)
|
||||
return;
|
||||
|
||||
var selectedIndex = document.getElementById("acceptDeclineLicense")
|
||||
.selectedIndex;
|
||||
// 0 == Accept, 1 == Decline
|
||||
var licenseAccepted = (selectedIndex == 0);
|
||||
gUpdates.wiz.canAdvance = licenseAccepted;
|
||||
},
|
||||
|
||||
/**
|
||||
* The non-standard "Back" button.
|
||||
*/
|
||||
onExtra1: function() {
|
||||
gUpdates.wiz.goTo(gUpdates.updatesFoundPageId);
|
||||
},
|
||||
|
||||
/**
|
||||
* When the user clicks next after accepting the license
|
||||
*/
|
||||
onWizardNext: function() {
|
||||
try {
|
||||
gUpdates.update.setProperty("licenseAccepted", "true");
|
||||
var um = CoC["@mozilla.org/updates/update-manager;1"].
|
||||
getService(CoI.nsIUpdateManager);
|
||||
um.saveUpdates();
|
||||
}
|
||||
catch (e) {
|
||||
LOG("gLicensePage", "onWizardNext - nsIUpdateManager:saveUpdates() " +
|
||||
"failed: " + e);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* When the user cancels the wizard
|
||||
*/
|
||||
onWizardCancel: function() {
|
||||
try {
|
||||
var licenseContent = document.getElementById("licenseContent");
|
||||
// If the license was downloading, stop it.
|
||||
if (licenseContent)
|
||||
licenseContent.stopDownloading();
|
||||
}
|
||||
catch (e) {
|
||||
LOG("gLicensePage", "onWizardCancel - " +
|
||||
"licenseContent.stopDownloading() failed: " + e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The "Update is Downloading" page - provides feedback for the download
|
||||
* process plus a pause/resume UI
|
||||
|
|
|
@ -128,28 +128,6 @@
|
|||
<remotecontent id="updateMoreInfoContent" flex="1" remotetype="billboard"/>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage id="license" pageid="license" next="downloading"
|
||||
object="gLicensePage" onpageshow="gLicensePage.onPageShow();"
|
||||
onextra1="gLicensePage.onExtra1();">
|
||||
<updateheader label="&license.titleText;"/>
|
||||
<vbox class="update-content" flex="1">
|
||||
<label>&license.instructionText;</label>
|
||||
<!-- note: the localized strings used by remotecontent are prefixed by
|
||||
the id for the remotecontent (e.g. licenseContentNotFound,
|
||||
licenseContentDownloading, etc.) -->
|
||||
<remotecontent id="licenseContent" flex="1" remotetype="license"/>
|
||||
<separator class="thin"/>
|
||||
<radiogroup id="acceptDeclineLicense" align="start"
|
||||
onselect="gLicensePage.onAcceptDeclineRadio();">
|
||||
<radio id="accept" label="&license.accept;"
|
||||
accesskey="&license.accept.accesskey;"/>
|
||||
<radio id="decline" label="&license.decline;"
|
||||
accesskey="&license.decline.accesskey;"
|
||||
selected="true"/>
|
||||
</radiogroup>
|
||||
</vbox>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage id="downloading" pageid="downloading"
|
||||
object="gDownloadingPage" onextra1="gDownloadingPage.onHide();"
|
||||
onpageshow="gDownloadingPage.onPageShow();">
|
||||
|
|
|
@ -145,14 +145,6 @@ interface nsIUpdate : nsISupports
|
|||
*/
|
||||
attribute AString billboardURL;
|
||||
|
||||
/**
|
||||
* The URL to a HTML fragment that contains a license for this update. If
|
||||
* this is specified, the user is shown the license file after they choose
|
||||
* to install the update and they must agree to it before the download
|
||||
* commences.
|
||||
*/
|
||||
attribute AString licenseURL;
|
||||
|
||||
/**
|
||||
* The URL to the Update Service that supplied this update.
|
||||
*/
|
||||
|
|
|
@ -1586,7 +1586,6 @@ function Update(update) {
|
|||
case "buildID":
|
||||
case "channel":
|
||||
case "displayVersion":
|
||||
case "licenseURL":
|
||||
case "name":
|
||||
case "platformVersion":
|
||||
case "previousAppVersion":
|
||||
|
@ -1721,9 +1720,6 @@ Update.prototype = {
|
|||
if (this.detailsURL) {
|
||||
update.setAttribute("detailsURL", this.detailsURL);
|
||||
}
|
||||
if (this.licenseURL) {
|
||||
update.setAttribute("licenseURL", this.licenseURL);
|
||||
}
|
||||
if (this.platformVersion) {
|
||||
update.setAttribute("platformVersion", this.platformVersion);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче