| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { | 5 login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| 6 /* Code which is embedded inside of the webview. See below for details. | 6 /* Code which is embedded inside of the webview. See below for details. |
| 7 /** @const */ var INJECTED_WEBVIEW_SCRIPT = String.raw` | 7 /** @const */ var INJECTED_WEBVIEW_SCRIPT = String.raw` |
| 8 (function() { | 8 (function() { |
| 9 // <include src="../keyboard/keyboard_utils.js"> | 9 // <include src="../keyboard/keyboard_utils.js"> |
| 10 keyboard.initializeKeyboardFlow(true); | 10 keyboard.initializeKeyboardFlow(true); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 $('oauth-enroll-success-card').submitButton.focus(); | 318 $('oauth-enroll-success-card').submitButton.focus(); |
| 319 } else if (step == STEP_ABE_SUCCESS) { | 319 } else if (step == STEP_ABE_SUCCESS) { |
| 320 $('oauth-enroll-abe-success-card').submitButton.focus(); | 320 $('oauth-enroll-abe-success-card').submitButton.focus(); |
| 321 } else if (step == STEP_ATTRIBUTE_PROMPT) { | 321 } else if (step == STEP_ATTRIBUTE_PROMPT) { |
| 322 $('oauth-enroll-asset-id').focus(); | 322 $('oauth-enroll-asset-id').focus(); |
| 323 } else if (step == STEP_ATTRIBUTE_PROMPT_ERROR) { | 323 } else if (step == STEP_ATTRIBUTE_PROMPT_ERROR) { |
| 324 $('oauth-enroll-attribute-prompt-error-card').submitButton.focus(); | 324 $('oauth-enroll-attribute-prompt-error-card').submitButton.focus(); |
| 325 } else if (step == STEP_AD_JOIN) { | 325 } else if (step == STEP_AD_JOIN) { |
| 326 this.offlineAdUi_.disabled = false; | 326 this.offlineAdUi_.disabled = false; |
| 327 this.offlineAdUi_.setUser(); | 327 this.offlineAdUi_.setUser(); |
| 328 this.offlineAdUi_.setInvalid(ACTIVE_DIRECTORY_ERROR_STATE.NONE); |
| 328 } | 329 } |
| 329 | 330 |
| 330 this.currentStep_ = step; | 331 this.currentStep_ = step; |
| 331 this.lastBackMessageValue_ = false; | 332 this.lastBackMessageValue_ = false; |
| 332 this.updateControlsState(); | 333 this.updateControlsState(); |
| 333 }, | 334 }, |
| 334 | 335 |
| 335 /** | 336 /** |
| 336 * Sets an error message and switches to the error screen. | 337 * Sets an error message and switches to the error screen. |
| 337 * @param {string} message the error message. | 338 * @param {string} message the error message. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 349 retry ? loadTimeData.getString('oauthEnrollRetry') : ''; | 350 retry ? loadTimeData.getString('oauthEnrollRetry') : ''; |
| 350 this.showStep(STEP_ERROR); | 351 this.showStep(STEP_ERROR); |
| 351 }, | 352 }, |
| 352 | 353 |
| 353 doReload: function() { | 354 doReload: function() { |
| 354 this.lastBackMessageValue_ = false; | 355 this.lastBackMessageValue_ = false; |
| 355 this.authenticator_.reload(); | 356 this.authenticator_.reload(); |
| 356 this.updateControlsState(); | 357 this.updateControlsState(); |
| 357 }, | 358 }, |
| 358 | 359 |
| 359 invalidateAd: function(machineName, user) { | 360 invalidateAd: function(machineName, user, errorState) { |
| 360 this.offlineAdUi_.disabled = false; | 361 this.offlineAdUi_.disabled = false; |
| 361 this.offlineAdUi_.setUser(user, machineName); | 362 this.offlineAdUi_.setUser(user, machineName); |
| 363 this.offlineAdUi_.setInvalid(errorState); |
| 362 }, | 364 }, |
| 363 | 365 |
| 364 /** | 366 /** |
| 365 * Retries the enrollment process after an error occurred in a previous | 367 * Retries the enrollment process after an error occurred in a previous |
| 366 * attempt. This goes to the C++ side through |chrome| first to clean up the | 368 * attempt. This goes to the C++ side through |chrome| first to clean up the |
| 367 * profile, so that the next attempt is performed with a clean state. | 369 * profile, so that the next attempt is performed with a clean state. |
| 368 */ | 370 */ |
| 369 doRetry_: function() { | 371 doRetry_: function() { |
| 370 chrome.send('oauthEnrollRetry'); | 372 chrome.send('oauthEnrollRetry'); |
| 371 }, | 373 }, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 this.navigation_.refreshVisible = this.isAtTheBeginning() && | 409 this.navigation_.refreshVisible = this.isAtTheBeginning() && |
| 408 !this.isManualEnrollment_; | 410 !this.isManualEnrollment_; |
| 409 this.navigation_.closeVisible = (this.currentStep_ == STEP_SIGNIN || | 411 this.navigation_.closeVisible = (this.currentStep_ == STEP_SIGNIN || |
| 410 this.currentStep_ == STEP_ERROR || | 412 this.currentStep_ == STEP_ERROR || |
| 411 this.currentStep_ == STEP_AD_JOIN) && | 413 this.currentStep_ == STEP_AD_JOIN) && |
| 412 !this.navigation_.refreshVisible; | 414 !this.navigation_.refreshVisible; |
| 413 $('login-header-bar').updateUI_(); | 415 $('login-header-bar').updateUI_(); |
| 414 } | 416 } |
| 415 }; | 417 }; |
| 416 }); | 418 }); |
| OLD | NEW |