| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 this.updateControlsState(); | 128 this.updateControlsState(); |
| 129 }).bind(this)); | 129 }).bind(this)); |
| 130 | 130 |
| 131 this.authenticator_.addEventListener('backButton', | 131 this.authenticator_.addEventListener('backButton', |
| 132 (function(e) { | 132 (function(e) { |
| 133 this.lastBackMessageValue_ = !!e.detail; | 133 this.lastBackMessageValue_ = !!e.detail; |
| 134 $('oauth-enroll-auth-view').focus(); | 134 $('oauth-enroll-auth-view').focus(); |
| 135 this.updateControlsState(); | 135 this.updateControlsState(); |
| 136 }).bind(this)); | 136 }).bind(this)); |
| 137 | 137 |
| 138 this.authenticator_.addEventListener('dialogShown', |
| 139 (function(e) { |
| 140 this.navigation_.disabled = true; |
| 141 }).bind(this)); |
| 142 |
| 143 this.authenticator_.addEventListener('dialogHidden', |
| 144 (function(e) { |
| 145 this.navigation_.disabled = false; |
| 146 }).bind(this)); |
| 147 |
| 138 this.authenticator_.insecureContentBlockedCallback = | 148 this.authenticator_.insecureContentBlockedCallback = |
| 139 (function(url) { | 149 (function(url) { |
| 140 this.showError( | 150 this.showError( |
| 141 loadTimeData.getStringF('insecureURLEnrollmentError', url), | 151 loadTimeData.getStringF('insecureURLEnrollmentError', url), |
| 142 false); | 152 false); |
| 143 }).bind(this); | 153 }).bind(this); |
| 144 | 154 |
| 145 this.authenticator_.missingGaiaInfoCallback = | 155 this.authenticator_.missingGaiaInfoCallback = |
| 146 (function() { | 156 (function() { |
| 147 this.showError( | 157 this.showError( |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 this.authenticator_.load(cr.login.Authenticator.AuthMode.DEFAULT, | 237 this.authenticator_.load(cr.login.Authenticator.AuthMode.DEFAULT, |
| 228 gaiaParams); | 238 gaiaParams); |
| 229 | 239 |
| 230 var modes = ['manual', 'forced', 'recovery']; | 240 var modes = ['manual', 'forced', 'recovery']; |
| 231 for (var i = 0; i < modes.length; ++i) { | 241 for (var i = 0; i < modes.length; ++i) { |
| 232 this.classList.toggle('mode-' + modes[i], | 242 this.classList.toggle('mode-' + modes[i], |
| 233 data.enrollment_mode == modes[i]); | 243 data.enrollment_mode == modes[i]); |
| 234 } | 244 } |
| 235 this.isManualEnrollment_ = data.enrollment_mode === 'manual'; | 245 this.isManualEnrollment_ = data.enrollment_mode === 'manual'; |
| 236 this.isCancelDisabled = true; | 246 this.isCancelDisabled = true; |
| 247 this.navigation_.disabled = false; |
| 237 | 248 |
| 238 this.showStep(data.attestationBased ? STEP_WORKING : STEP_SIGNIN); | 249 this.showStep(data.attestationBased ? STEP_WORKING : STEP_SIGNIN); |
| 239 }, | 250 }, |
| 240 | 251 |
| 241 onBeforeHide: function() { | 252 onBeforeHide: function() { |
| 242 $('login-header-bar').signinUIState = SIGNIN_UI_STATE.HIDDEN; | 253 $('login-header-bar').signinUIState = SIGNIN_UI_STATE.HIDDEN; |
| 243 }, | 254 }, |
| 244 | 255 |
| 245 /** | 256 /** |
| 246 * Shows attribute-prompt step with pre-filled asset ID and | 257 * Shows attribute-prompt step with pre-filled asset ID and |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 this.lastBackMessageValue_; | 381 this.lastBackMessageValue_; |
| 371 this.navigation_.refreshVisible = this.isAtTheBeginning() && | 382 this.navigation_.refreshVisible = this.isAtTheBeginning() && |
| 372 !this.isManualEnrollment_; | 383 !this.isManualEnrollment_; |
| 373 this.navigation_.closeVisible = (this.currentStep_ == STEP_SIGNIN || | 384 this.navigation_.closeVisible = (this.currentStep_ == STEP_SIGNIN || |
| 374 this.currentStep_ == STEP_ERROR) && | 385 this.currentStep_ == STEP_ERROR) && |
| 375 !this.navigation_.refreshVisible; | 386 !this.navigation_.refreshVisible; |
| 376 $('login-header-bar').updateUI_(); | 387 $('login-header-bar').updateUI_(); |
| 377 } | 388 } |
| 378 }; | 389 }; |
| 379 }); | 390 }); |
| OLD | NEW |