OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 Oobe signin screen implementation. | 6 * @fileoverview Oobe signin screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 /** | 137 /** |
138 * Event handler that is invoked when HTML5 message is received. | 138 * Event handler that is invoked when HTML5 message is received. |
139 * @param e {object} Payload of the received HTML5 message. | 139 * @param e {object} Payload of the received HTML5 message. |
140 */ | 140 */ |
141 onMessage_: function(e) { | 141 onMessage_: function(e) { |
142 var msg = e.data; | 142 var msg = e.data; |
143 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { | 143 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { |
144 chrome.send('completeLogin', [msg.email, msg.password] ); | 144 chrome.send('completeLogin', [msg.email, msg.password] ); |
145 this.loading = true; | 145 this.loading = true; |
146 } else if (msg.method == 'loginUILoaded' && this.isAuthExtMessage_(e)) { | 146 } else if (msg.method == 'loginUILoaded' && this.isAuthExtMessage_(e)) { |
| 147 $('offline-message').update(); |
147 this.loading = false; | 148 this.loading = false; |
148 chrome.send('loginWebuiReady'); | 149 chrome.send('loginWebuiReady'); |
149 } | 150 } |
150 }, | 151 }, |
151 | 152 |
152 /** | 153 /** |
153 * Clears input fields and switches to input mode. | 154 * Clears input fields and switches to input mode. |
154 * @param {boolean} takeFocus True to take focus. | 155 * @param {boolean} takeFocus True to take focus. |
155 */ | 156 */ |
156 reset: function(takeFocus) { | 157 reset: function(takeFocus) { |
157 // Reload and show the sign-in UI if needed. | 158 // Reload and show the sign-in UI if needed. |
158 if (takeFocus) | 159 if (takeFocus) |
159 Oobe.showSigninUI(); | 160 Oobe.showSigninUI(); |
160 } | 161 } |
161 }; | 162 }; |
162 | 163 |
163 return { | 164 return { |
164 GaiaSigninScreen: GaiaSigninScreen | 165 GaiaSigninScreen: GaiaSigninScreen |
165 }; | 166 }; |
166 }); | 167 }); |
OLD | NEW |