| 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 cr.define('oobe', function() { | 5 cr.define('oobe', function() { |
| 6 /** | 6 /** |
| 7 * Creates a new oobe screen div. | 7 * Creates a new oobe screen div. |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {HTMLDivElement} | 9 * @extends {HTMLDivElement} |
| 10 */ | 10 */ |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 */ | 212 */ |
| 213 showStep: function(step) { | 213 showStep: function(step) { |
| 214 $('oauth-enroll-cancel-button').hidden = true; | 214 $('oauth-enroll-cancel-button').hidden = true; |
| 215 $('oauth-enroll-try-again-button').hidden = true; | 215 $('oauth-enroll-try-again-button').hidden = true; |
| 216 $('oauth-enroll-explain-button').hidden = true; | 216 $('oauth-enroll-explain-button').hidden = true; |
| 217 $('oauth-enroll-done-button').hidden = true; | 217 $('oauth-enroll-done-button').hidden = true; |
| 218 for (var i = 0; i < this.steps_.length; i++) { | 218 for (var i = 0; i < this.steps_.length; i++) { |
| 219 var theStep = this.steps_[i]; | 219 var theStep = this.steps_[i]; |
| 220 var active = (theStep.name == step); | 220 var active = (theStep.name == step); |
| 221 $('oauth-enroll-step-' + theStep.name).hidden = !active; | 221 $('oauth-enroll-step-' + theStep.name).hidden = !active; |
| 222 if (active && theStep.button) { | 222 if (theStep.button) { |
| 223 var button = $('oauth-enroll-' + theStep.button + '-button'); | 223 var button = $('oauth-enroll-' + theStep.button + '-button'); |
| 224 button.hidden = false; | 224 button.autofocus = false; |
| 225 if (theStep.focusButton) | 225 if (active) { |
| 226 button.focus(); | 226 button.hidden = false; |
| 227 if (theStep.focusButton) { |
| 228 button.focus(); |
| 229 button.autofocus = true; |
| 230 } |
| 231 } |
| 227 } | 232 } |
| 228 } | 233 } |
| 229 }, | 234 }, |
| 230 | 235 |
| 231 /** | 236 /** |
| 232 * Sets an error message and switches to the error screen. | 237 * Sets an error message and switches to the error screen. |
| 233 * @param {string} message the error message. | 238 * @param {string} message the error message. |
| 234 * @param {boolean} retry whether the retry link should be shown. | 239 * @param {boolean} retry whether the retry link should be shown. |
| 235 */ | 240 */ |
| 236 showError: function(message, retry) { | 241 showError: function(message, retry) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 var msg = m.data; | 308 var msg = m.data; |
| 304 if (msg.method == 'completeLogin' && this.isSigninMessage_(m)) | 309 if (msg.method == 'completeLogin' && this.isSigninMessage_(m)) |
| 305 chrome.send('oauthEnrollCompleteLogin', [msg.email, msg.password]); | 310 chrome.send('oauthEnrollCompleteLogin', [msg.email, msg.password]); |
| 306 } | 311 } |
| 307 }; | 312 }; |
| 308 | 313 |
| 309 return { | 314 return { |
| 310 OAuthEnrollmentScreen: OAuthEnrollmentScreen | 315 OAuthEnrollmentScreen: OAuthEnrollmentScreen |
| 311 }; | 316 }; |
| 312 }); | 317 }); |
| OLD | NEW |