| Index: chrome/browser/resources/help/help_page.js
|
| diff --git a/chrome/browser/resources/help/help_page.js b/chrome/browser/resources/help/help_page.js
|
| index 2889d92995810c5b7b88c707a25921c06d2cc2ec..93c13526f5d2d62b49368e5b99b0398ec40f9f9d 100644
|
| --- a/chrome/browser/resources/help/help_page.js
|
| +++ b/chrome/browser/resources/help/help_page.js
|
| @@ -64,6 +64,18 @@ cr.define('help', function() {
|
| */
|
| haveNeverCheckedForUpdates_: true,
|
|
|
| + /**
|
| + * Last EndofLife status received from the version updater.
|
| + * @private
|
| + */
|
| + eolStatus_: null,
|
| +
|
| + /**
|
| + * Last EndofLife message received from the version updater.
|
| + * @private
|
| + */
|
| + eolMessage_: null,
|
| +
|
| /** @override */
|
| initializePage: function() {
|
| Page.prototype.initializePage.call(this);
|
| @@ -306,6 +318,18 @@ cr.define('help', function() {
|
| },
|
|
|
| /**
|
| + * @param {string} eolStatus: The EndofLife status of the device.
|
| + * @param {string} eolMessage: The EndofLife message to display.
|
| + * @private
|
| + */
|
| + updateEolMessage_: function(eolStatus, eolMessage) {
|
| + this.eolStatus_ = eolStatus;
|
| + this.eolMessage_ = eolSessage;
|
| +
|
| + this.updateUI_();
|
| + },
|
| +
|
| + /**
|
| * Updates UI elements on the page according to current state.
|
| * @private
|
| */
|
| @@ -313,6 +337,8 @@ cr.define('help', function() {
|
| var status = this.status_;
|
| var message = this.message_;
|
| var channel = this.targetChannel_;
|
| + var eolStatus = this.eolStatus_;
|
| + var eolMessage = this.eolMessage_;
|
|
|
| if (this.channelList_.indexOf(channel) >= 0) {
|
| $('current-channel').textContent = loadTimeData.getStringF(
|
| @@ -370,6 +396,15 @@ cr.define('help', function() {
|
| $('update-status-message').innerHTML = message;
|
| }
|
|
|
| + // Show EndofLife Strings if applicable
|
| + if (eolStatus == 'device_supported') {
|
| + $('eol-message').hidden = true;
|
| + } else if (eolStatus == 'device_endoflife') {
|
| + $('eol-message').innerHTML = eolMessage;
|
| + $('eol-message').hidden = false;
|
| + }
|
| +
|
| +
|
| if (cr.isChromeOS) {
|
| $('change-channel').disabled = !this.canChangeChannel_ ||
|
| status == 'nearly_updated';
|
| @@ -392,9 +427,11 @@ cr.define('help', function() {
|
| // Re-enable the update button if we are in a stale 'updated' status or
|
| // update has failed, and disable it if there's an update in progress or
|
| // updates are disabled by policy.
|
| + // In addition, Update button will be disabled when device is in eol
|
| + // status
|
| $('request-update').disabled =
|
| !((this.haveNeverCheckedForUpdates_ && status == 'updated') ||
|
| - status == 'failed');
|
| + status == 'failed') || (eolStatus == 'device_endoflife');
|
| // If updates are disabled by policy, unhide the
|
| // controlled-feature-icon.
|
| $('controlled-feature-icon').hidden = (status != 'disabled_by_admin');
|
| @@ -413,7 +450,8 @@ cr.define('help', function() {
|
| if (cr.isChromeOS) {
|
| // Assume the "updated" status is stale if we haven't checked yet.
|
| if (status == 'updated' && this.haveNeverCheckedForUpdates_ ||
|
| - status == 'disabled_by_admin') {
|
| + status == 'disabled_by_admin' ||
|
| + eolStatus == 'device_endoflife') {
|
| container.hidden = true;
|
| }
|
|
|
| @@ -732,6 +770,11 @@ cr.define('help', function() {
|
| HelpPage.getInstance().setRegulatoryLabelText_(text);
|
| };
|
|
|
| + HelpPage.updateEolMessage = function(eolStatus, eolMessage) {
|
| + assert(cr.isChromeOS);
|
| + HelpPage.getInstance().updateEolMessage_(eolStatus, eolMessage);
|
| + };
|
| +
|
| // Export
|
| return {
|
| HelpPage: HelpPage
|
|
|