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

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

Issue 871483003: Add device policy to disallow shutdown - WebUI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits rebase Created 5 years, 11 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/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..3a3ba9bade95c22dd77a02c806a211094f9d46a2 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.handleShutdownClick_);
+ $('restart-button').addEventListener('click',
+ this.handleShutdownClick_);
$('add-user-button').addEventListener('click',
this.handleAddUserClick_);
$('cancel-add-user-button').addEventListener('click',
@@ -177,6 +189,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 +277,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 =
« no previous file with comments | « chrome/browser/resources/chromeos/login/header_bar.html ('k') | chrome/browser/resources/chromeos/login/login_common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698