Chromium Code Reviews| 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 = |