| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Login UI header bar implementation. | 6 * @fileoverview Login UI header bar implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 /** | 10 /** |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 $('add-user-button').addEventListener('click', | 35 $('add-user-button').addEventListener('click', |
| 36 this.handleAddUserClick_); | 36 this.handleAddUserClick_); |
| 37 $('cancel-add-user-button').addEventListener('click', | 37 $('cancel-add-user-button').addEventListener('click', |
| 38 this.handleCancelAddUserClick_); | 38 this.handleCancelAddUserClick_); |
| 39 $('guest-user-header-bar-item').addEventListener('click', | 39 $('guest-user-header-bar-item').addEventListener('click', |
| 40 this.handleGuestClick_); | 40 this.handleGuestClick_); |
| 41 $('guest-user-button').addEventListener('click', | 41 $('guest-user-button').addEventListener('click', |
| 42 this.handleGuestClick_); | 42 this.handleGuestClick_); |
| 43 $('sign-out-user-button').addEventListener('click', | 43 $('sign-out-user-button').addEventListener('click', |
| 44 this.handleSignoutClick_); | 44 this.handleSignoutClick_); |
| 45 $('cancel-multiple-sign-in-button').addEventListener('click', |
| 46 this.handleCancelMultipleSignInClick_); |
| 45 | 47 |
| 46 if (loadTimeData.getBoolean('enableAppMode') && | 48 if (loadTimeData.getBoolean('enableAppMode') && |
| 47 loadTimeData.getString('screenType') == 'login') { | 49 document.documentElement.getAttribute('screen') == 'login') { |
| 48 login.AppsMenuButton.decorate($('show-apps-button')); | 50 login.AppsMenuButton.decorate($('show-apps-button')); |
| 49 } | 51 } |
| 50 }, | 52 }, |
| 51 | 53 |
| 52 /** | 54 /** |
| 53 * Tab index value for all button elements. | 55 * Tab index value for all button elements. |
| 54 * @type {number} | 56 * @type {number} |
| 55 */ | 57 */ |
| 56 set buttonsTabIndex(tabIndex) { | 58 set buttonsTabIndex(tabIndex) { |
| 57 var buttons = this.getElementsByTagName('button'); | 59 var buttons = this.getElementsByTagName('button'); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 /** | 126 /** |
| 125 * Shutdown button click handler. | 127 * Shutdown button click handler. |
| 126 * @private | 128 * @private |
| 127 */ | 129 */ |
| 128 handleShutdownClick_: function(e) { | 130 handleShutdownClick_: function(e) { |
| 129 chrome.send('shutdownSystem'); | 131 chrome.send('shutdownSystem'); |
| 130 e.stopPropagation(); | 132 e.stopPropagation(); |
| 131 }, | 133 }, |
| 132 | 134 |
| 133 /** | 135 /** |
| 136 * Cancel user adding button handler. |
| 137 * @private |
| 138 */ |
| 139 handleCancelMultipleSignInClick_: function(e) { |
| 140 chrome.send('cancelUserAdding'); |
| 141 e.stopPropagation(); |
| 142 }, |
| 143 |
| 144 /** |
| 134 * If true then "Browse as Guest" button is shown. | 145 * If true then "Browse as Guest" button is shown. |
| 135 * @type {boolean} | 146 * @type {boolean} |
| 136 */ | 147 */ |
| 137 set showGuestButton(value) { | 148 set showGuestButton(value) { |
| 138 this.showGuest_ = value; | 149 this.showGuest_ = value; |
| 139 this.updateUI_(); | 150 this.updateUI_(); |
| 140 }, | 151 }, |
| 141 | 152 |
| 142 /** | 153 /** |
| 143 * Update current header bar UI. | 154 * Update current header bar UI. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 isMultiProfilesUI; | 199 isMultiProfilesUI; |
| 189 $('guest-user-header-bar-item').hidden = gaiaIsActive || | 200 $('guest-user-header-bar-item').hidden = gaiaIsActive || |
| 190 managedUserCreationDialogIsActive || | 201 managedUserCreationDialogIsActive || |
| 191 !this.showGuest_ || | 202 !this.showGuest_ || |
| 192 wrongHWIDWarningIsActive || | 203 wrongHWIDWarningIsActive || |
| 193 isMultiProfilesUI; | 204 isMultiProfilesUI; |
| 194 $('add-user-header-bar-item').hidden = | 205 $('add-user-header-bar-item').hidden = |
| 195 $('add-user-button').hidden && $('cancel-add-user-button').hidden; | 206 $('add-user-button').hidden && $('cancel-add-user-button').hidden; |
| 196 $('apps-header-bar-item').hidden = !this.hasApps_ || | 207 $('apps-header-bar-item').hidden = !this.hasApps_ || |
| 197 (!gaiaIsActive && !accountPickerIsActive); | 208 (!gaiaIsActive && !accountPickerIsActive); |
| 209 $('cancel-multiple-sign-in-item').hidden = !isMultiProfilesUI; |
| 198 | 210 |
| 199 if (!$('apps-header-bar-item').hidden) | 211 if (!$('apps-header-bar-item').hidden) |
| 200 $('show-apps-button').didShow(); | 212 $('show-apps-button').didShow(); |
| 201 }, | 213 }, |
| 202 | 214 |
| 203 /** | 215 /** |
| 204 * Animates Header bar to hide from the screen. | 216 * Animates Header bar to hide from the screen. |
| 205 * @param {function()} callback will be called once animation is finished. | 217 * @param {function()} callback will be called once animation is finished. |
| 206 */ | 218 */ |
| 207 animateOut: function(callback) { | 219 animateOut: function(callback) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 237 * Convenience wrapper of animateIn. | 249 * Convenience wrapper of animateIn. |
| 238 */ | 250 */ |
| 239 HeaderBar.animateIn = function() { | 251 HeaderBar.animateIn = function() { |
| 240 $('login-header-bar').animateIn(); | 252 $('login-header-bar').animateIn(); |
| 241 } | 253 } |
| 242 | 254 |
| 243 return { | 255 return { |
| 244 HeaderBar: HeaderBar | 256 HeaderBar: HeaderBar |
| 245 }; | 257 }; |
| 246 }); | 258 }); |
| OLD | NEW |