| 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 login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { | 5 login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| 6 /** @const */ var STEP_SIGNIN = 'signin'; | 6 /** @const */ var STEP_SIGNIN = 'signin'; |
| 7 /** @const */ var STEP_WORKING = 'working'; | 7 /** @const */ var STEP_WORKING = 'working'; |
| 8 /** @const */ var STEP_ERROR = 'error'; | 8 /** @const */ var STEP_ERROR = 'error'; |
| 9 /** @const */ var STEP_EXPLAIN = 'explain'; | 9 /** @const */ var STEP_EXPLAIN = 'explain'; |
| 10 /** @const */ var STEP_SUCCESS = 'success'; | 10 /** @const */ var STEP_SUCCESS = 'success'; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 url += '?gaiaUrl=' + encodeURIComponent(data.gaiaUrl); | 174 url += '?gaiaUrl=' + encodeURIComponent(data.gaiaUrl); |
| 175 this.signInUrl_ = url; | 175 this.signInUrl_ = url; |
| 176 this.setIsAutoEnrollment(data.is_auto_enrollment); | 176 this.setIsAutoEnrollment(data.is_auto_enrollment); |
| 177 this.preventCancellation_ = data.prevent_cancellation; | 177 this.preventCancellation_ = data.prevent_cancellation; |
| 178 $('oauth-enroll-signin-frame').contentWindow.location.href = | 178 $('oauth-enroll-signin-frame').contentWindow.location.href = |
| 179 this.signInUrl_; | 179 this.signInUrl_; |
| 180 if (this.preventCancellation_) { | 180 if (this.preventCancellation_) { |
| 181 $('oauth-enroll-cancel-button').textContent = | 181 $('oauth-enroll-cancel-button').textContent = |
| 182 loadTimeData.getString('oauthEnrollCancelAutoEnrollmentGoBack'); | 182 loadTimeData.getString('oauthEnrollCancelAutoEnrollmentGoBack'); |
| 183 } | 183 } |
| 184 this.classList.toggle('saml', false); |
| 184 | 185 |
| 185 this.showStep(STEP_SIGNIN); | 186 this.showStep(STEP_SIGNIN); |
| 186 }, | 187 }, |
| 187 | 188 |
| 188 /** | 189 /** |
| 189 * Cancels enrollment and drops the user back to the login screen. | 190 * Cancels enrollment and drops the user back to the login screen. |
| 190 */ | 191 */ |
| 191 cancel: function() { | 192 cancel: function() { |
| 192 if (this.isAutoEnrollment_) | 193 if (this.isAutoEnrollment_) |
| 193 return; | 194 return; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 324 |
| 324 if (msg.method == 'retrieveAuthenticatedUserEmail') { | 325 if (msg.method == 'retrieveAuthenticatedUserEmail') { |
| 325 // A user has successfully authenticated via SAML. However, the user's | 326 // A user has successfully authenticated via SAML. However, the user's |
| 326 // identity is not known. Instead of reporting success immediately, | 327 // identity is not known. Instead of reporting success immediately, |
| 327 // retrieve the user's e-mail address first. | 328 // retrieve the user's e-mail address first. |
| 328 this.attemptToken_ = msg.attemptToken; | 329 this.attemptToken_ = msg.attemptToken; |
| 329 this.showWorking(null); | 330 this.showWorking(null); |
| 330 chrome.send('oauthEnrollRetrieveAuthenticatedUserEmail', | 331 chrome.send('oauthEnrollRetrieveAuthenticatedUserEmail', |
| 331 [msg.attemptToken]); | 332 [msg.attemptToken]); |
| 332 } | 333 } |
| 334 |
| 335 if (msg.method == 'authPageLoaded') { |
| 336 if (msg.isSAML) { |
| 337 $('oauth-saml-notice-message').textContent = loadTimeData.getStringF( |
| 338 'samlNotice', |
| 339 msg.domain); |
| 340 } |
| 341 this.classList.toggle('saml', msg.isSAML); |
| 342 } |
| 333 } | 343 } |
| 334 }; | 344 }; |
| 335 }); | 345 }); |
| 336 | 346 |
| OLD | NEW |