Chromium Code Reviews| 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..a7388d01296e15f49337e3898644f82090acaa8c 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, |
|
xiyuan
2016/06/17 20:02:09
nit: eolStatus_, JS uses camel case with the first
xiaoyinh(OOO Sep 11-29)
2016/06/17 22:36:53
Done.
|
| + |
| + /** |
| + * Last EndofLife message received from the version updater. |
| + * @private |
| + */ |
| + eolmessage_: null, |
|
xiyuan
2016/06/17 20:02:09
nit: eolMessage_
xiaoyinh(OOO Sep 11-29)
2016/06/17 22:36:53
Done.
|
| + |
| /** @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) { |
|
xiyuan
2016/06/17 20:02:09
nit: eolStatus, eolMessage
xiaoyinh(OOO Sep 11-29)
2016/06/17 22:36:53
Done.
|
| + this.eolstatus_ = eolstatus; |
| + this.eolmessage_ = eolmessage; |
| + |
| + 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_; |
|
xiyuan
2016/06/17 20:02:09
ditto
xiaoyinh(OOO Sep 11-29)
2016/06/17 22:36:53
Done.
|
| 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 |