OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview Login UI header bar implementation. |
| 7 */ |
| 8 |
| 9 cr.define('login', function() { |
| 10 |
| 11 /** |
| 12 * Creates a header bar element. |
| 13 * @constructor |
| 14 * @extends {HTMLDivElement} |
| 15 */ |
| 16 var HeaderBar = cr.ui.define('div'); |
| 17 |
| 18 HeaderBar.prototype = { |
| 19 __proto__: HTMLDivElement.prototype, |
| 20 |
| 21 /** @inheritDoc */ |
| 22 decorate: function() { |
| 23 $('shutdown-button').addEventListener('click', function(e) { |
| 24 chrome.send('shutdownSystem'); |
| 25 }); |
| 26 $('add-user-button').addEventListener('click', function(e) { |
| 27 if (window.navigator.onLine) { |
| 28 Oobe.showSigninUI(); |
| 29 } else { |
| 30 $('bubble').showTextForElement($('add-user-button'), |
| 31 localStrings.getString('addUserOfflineMessage')); |
| 32 } |
| 33 }); |
| 34 $('cancel-add-user-button').addEventListener('click', function(e) { |
| 35 this.hidden = true; |
| 36 $('add-user-button').hidden = false; |
| 37 Oobe.showScreen({id: SCREEN_ACCOUNT_PICKER}); |
| 38 }); |
| 39 } |
| 40 }; |
| 41 |
| 42 return { |
| 43 HeaderBar: HeaderBar |
| 44 }; |
| 45 }); |
OLD | NEW |