OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 Desktop User Chooser UI control bar implementation. | 6 * @fileoverview Desktop User Chooser UI control bar implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 /** | 10 /** |
11 * Creates a header bar element. | 11 * Creates a header bar element. |
12 * @constructor | 12 * @constructor |
13 * @extends {HTMLDivElement} | 13 * @extends {HTMLDivElement} |
14 */ | 14 */ |
15 var HeaderBar = cr.ui.define('div'); | 15 var HeaderBar = cr.ui.define('div'); |
16 | 16 |
17 HeaderBar.prototype = { | 17 HeaderBar.prototype = { |
18 __proto__: HTMLDivElement.prototype, | 18 __proto__: HTMLDivElement.prototype, |
19 | 19 |
20 // Whether guest button should be shown when header bar is in normal mode. | 20 // Whether guest button should be shown when header bar is in normal mode. |
21 showGuest_: true, | 21 showGuest_: true, |
22 | 22 |
23 // Current UI state of the sign-in screen. | 23 // Current UI state of the sign-in screen. |
24 signinUIState_: SIGNIN_UI_STATE.ACCOUNT_PICKER, | 24 signinUIState_: SIGNIN_UI_STATE.HIDDEN, |
25 | 25 |
26 // Whether to show kiosk apps menu. | 26 // Whether to show kiosk apps menu. |
27 hasApps_: false, | 27 hasApps_: false, |
28 | 28 |
29 /** @override */ | 29 /** @override */ |
30 decorate: function() { | 30 decorate: function() { |
31 $('add-user-button').addEventListener('click', | 31 $('add-user-button').addEventListener('click', |
32 this.handleAddUserClick_); | 32 this.handleAddUserClick_); |
33 $('cancel-add-user-button').addEventListener('click', | 33 $('cancel-add-user-button').addEventListener('click', |
34 this.handleCancelAddUserClick_); | 34 this.handleCancelAddUserClick_); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 /** | 110 /** |
111 * Update current header bar UI. | 111 * Update current header bar UI. |
112 * @type {number} state Current state of the sign-in screen | 112 * @type {number} state Current state of the sign-in screen |
113 * (see SIGNIN_UI_STATE). | 113 * (see SIGNIN_UI_STATE). |
114 */ | 114 */ |
115 set signinUIState(state) { | 115 set signinUIState(state) { |
116 this.signinUIState_ = state; | 116 this.signinUIState_ = state; |
117 this.updateUI_(); | 117 this.updateUI_(); |
118 }, | 118 }, |
119 | 119 |
| 120 get signinUIState() { |
| 121 return this.signinUIState_; |
| 122 }, |
| 123 |
120 /** | 124 /** |
121 * Whether the Cancel button is enabled during Gaia sign-in. | 125 * Whether the Cancel button is enabled during Gaia sign-in. |
122 * @type {boolean} | 126 * @type {boolean} |
123 */ | 127 */ |
124 set allowCancel(value) { | 128 set allowCancel(value) { |
125 this.allowCancel_ = value; | 129 this.allowCancel_ = value; |
126 this.updateUI_(); | 130 this.updateUI_(); |
127 }, | 131 }, |
128 | 132 |
129 /** | 133 /** |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 */ | 172 */ |
169 HeaderBar.animateOut = function(callback) { | 173 HeaderBar.animateOut = function(callback) { |
170 $('login-header-bar').animateOut(callback); | 174 $('login-header-bar').animateOut(callback); |
171 }; | 175 }; |
172 | 176 |
173 /** | 177 /** |
174 * Convenience wrapper of animateIn. | 178 * Convenience wrapper of animateIn. |
175 */ | 179 */ |
176 HeaderBar.animateIn = function() { | 180 HeaderBar.animateIn = function() { |
177 $('login-header-bar').animateIn(); | 181 $('login-header-bar').animateIn(); |
178 } | 182 }; |
179 | 183 |
180 return { | 184 return { |
181 HeaderBar: HeaderBar | 185 HeaderBar: HeaderBar |
182 }; | 186 }; |
183 }); | 187 }); |
OLD | NEW |