Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2511)

Unified Diff: chrome/browser/resources/help/help_page.js

Issue 2060623002: Implementation of Device End of Life Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify browsertest Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3bde0c6b27e19ba850747ba10c717a92fe91d24a 100644
--- a/chrome/browser/resources/help/help_page.js
+++ b/chrome/browser/resources/help/help_page.js
@@ -306,6 +306,20 @@ cr.define('help', function() {
},
/**
+ * @param {string} eol_status: The status of the eol.
+ * @param {string} message: eol message to display.
+ * @private
+ */
+ updateEolMessage_: function(eol_status, message) {
xiyuan 2016/06/16 22:41:28 JS uses a different style than C++ eol_status ->
xiaoyinh(OOO Sep 11-29) 2016/06/17 04:07:35 Done.
+ this.status_ = eol_status;
+ this.message_ = message;
xiyuan 2016/06/16 22:41:28 Can we introduce new properties to hold the eol_st
xiaoyinh(OOO Sep 11-29) 2016/06/17 04:07:35 Done.
+
+ this.updateUI_();
+ },
+
+
+
xiyuan 2016/06/16 22:41:28 nuke two and keep only one empty line.
xiaoyinh(OOO Sep 11-29) 2016/06/17 04:07:35 Done.
+ /**
* Updates UI elements on the page according to current state.
* @private
*/
@@ -370,6 +384,15 @@ cr.define('help', function() {
$('update-status-message').innerHTML = message;
}
+ // Show EndofLife Strings if applicable
+ if (status == 'device_supported') {
+ $('eol-message').hidden = true;
+ } else if (status == 'device_endoflife') {
+ $('eol-message').innerHTML = message;
+ $('eol-message').hidden = false;
+ }
+
+
if (cr.isChromeOS) {
$('change-channel').disabled = !this.canChangeChannel_ ||
status == 'nearly_updated';
@@ -392,9 +415,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') || (status == 'device_endoflife');
// If updates are disabled by policy, unhide the
// controlled-feature-icon.
$('controlled-feature-icon').hidden = (status != 'disabled_by_admin');
@@ -413,7 +438,7 @@ 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' || status == 'device_endoflife') {
container.hidden = true;
}
@@ -732,6 +757,11 @@ cr.define('help', function() {
HelpPage.getInstance().setRegulatoryLabelText_(text);
};
+ HelpPage.updateEolMessage = function(eol_status, message) {
+ assert(cr.isChromeOS);
+ HelpPage.getInstance().updateEolMessage_(eol_status, message);
+ };
+
// Export
return {
HelpPage: HelpPage

Powered by Google App Engine
This is Rietveld 408576698