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

Unified Diff: chrome/browser/resources/chromeos/login/header_bar.js

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shutdown_allowed => reboot_on_shutdown Created 6 years 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/chromeos/login/header_bar.js
diff --git a/chrome/browser/resources/chromeos/login/header_bar.js b/chrome/browser/resources/chromeos/login/header_bar.js
index 18735c3611f537c4aa3558204c868f18b71196fb..d5e7e6130aa0ec3519b6e970e3050e06338342ed 100644
--- a/chrome/browser/resources/chromeos/login/header_bar.js
+++ b/chrome/browser/resources/chromeos/login/header_bar.js
@@ -21,6 +21,14 @@ cr.define('login', function() {
// Whether guest button should be shown when header bar is in normal mode.
showGuest_: false,
+ // Whether the reboot button should be shown the when header bar is in
+ // normal mode.
+ showReboot_: false,
+
+ // Whether the shutdown button should be shown when the header bar is in
+ // normal mode.
+ showShutdown_: true,
+
// Current UI state of the sign-in screen.
signinUIState_: SIGNIN_UI_STATE.HIDDEN,
@@ -33,6 +41,10 @@ cr.define('login', function() {
this.handleShutdownClick_);
$('shutdown-button').addEventListener('click',
this.handleShutdownClick_);
+ $('restart-header-bar-item').addEventListener('click',
+ this.handleRestartClick_);
+ $('restart-button').addEventListener('click',
+ this.handleRestartClick_);
$('add-user-button').addEventListener('click',
this.handleAddUserClick_);
$('cancel-add-user-button').addEventListener('click',
@@ -147,6 +159,16 @@ cr.define('login', function() {
},
/**
+ * Restart button click handler.
+ *
+ * @private
+ */
+ handleRestartClick_: function(e) {
+ chrome.send('restartSystem');
stevenjb 2014/12/17 19:09:02 I think that this should also just call 'shutdownO
+ e.stopPropagation();
+ },
+
+ /**
* Cancel user adding button handler.
*
* @private
@@ -177,6 +199,26 @@ cr.define('login', function() {
},
/**
+ * If true the "Restart" button is shown.
+ *
+ * @type {boolean}
+ */
+ set showRebootButton(value) {
+ this.showReboot_ = value;
+ this.updateUI_();
+ },
+
+ /**
+ * If true the "Shutdown" button is shown.
+ *
+ * @type {boolean}
+ */
+ set showShutdownButton(value) {
+ this.showShutdown_ = value;
+ this.updateUI_();
+ },
+
+ /**
* Current header bar UI / sign in state.
*
* @type {number} state Current state of the sign-in screen (see
@@ -245,6 +287,8 @@ cr.define('login', function() {
wrongHWIDWarningIsActive ||
isSamlPasswordConfirm ||
isMultiProfilesUI;
+ $('restart-header-bar-item').hidden = !this.showReboot_;
+ $('shutdown-header-bar-item').hidden = !this.showShutdown_;
$('sign-out-user-item').hidden = !isLockScreen;
$('add-user-header-bar-item').hidden =

Powered by Google App Engine
This is Rietveld 408576698