| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 /** | 111 /** |
| 112 * Event handler that is invoked when HTML5 message is received. | 112 * Event handler that is invoked when HTML5 message is received. |
| 113 * @param e {object} Payload of the received HTML5 message. | 113 * @param e {object} Payload of the received HTML5 message. |
| 114 */ | 114 */ |
| 115 onMessage_: function(e) { | 115 onMessage_: function(e) { |
| 116 var msg = e.data; | 116 var msg = e.data; |
| 117 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { | 117 if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { |
| 118 chrome.send('completeLogin', [msg.email, msg.password] ); | 118 chrome.send('completeLogin', [msg.email, msg.password] ); |
| 119 this.loading = true; | 119 this.loading = true; |
| 120 } else if (msg.method == 'loginUILoaded' && this.isAuthExtMessage_(e)) { | 120 } else if (msg.method == 'loginUILoaded' && this.isAuthExtMessage_(e)) { |
| 121 $('offline-message').update(); |
| 121 this.loading = false; | 122 this.loading = false; |
| 122 } | 123 } |
| 123 }, | 124 }, |
| 124 | 125 |
| 125 /** | 126 /** |
| 126 * Clears input fields and switches to input mode. | 127 * Clears input fields and switches to input mode. |
| 127 * @param {boolean} takeFocus True to take focus. | 128 * @param {boolean} takeFocus True to take focus. |
| 128 */ | 129 */ |
| 129 reset: function(takeFocus) { | 130 reset: function(takeFocus) { |
| 130 // Reload and show the sign-in UI if needed. | 131 // Reload and show the sign-in UI if needed. |
| 131 if (takeFocus) | 132 if (takeFocus) |
| 132 Oobe.showSigninUI(); | 133 Oobe.showSigninUI(); |
| 133 } | 134 } |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 return { | 137 return { |
| 137 GaiaSigninScreen: GaiaSigninScreen | 138 GaiaSigninScreen: GaiaSigninScreen |
| 138 }; | 139 }; |
| 139 }); | 140 }); |
| OLD | NEW |