| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 links[i].hidden = !this.isAutoEnrollment_; | 177 links[i].hidden = !this.isAutoEnrollment_; |
| 178 }, | 178 }, |
| 179 | 179 |
| 180 /** | 180 /** |
| 181 * Event handler that is invoked just before the frame is shown. | 181 * Event handler that is invoked just before the frame is shown. |
| 182 * @param data {dictionary} Screen init payload, contains the signin frame | 182 * @param data {dictionary} Screen init payload, contains the signin frame |
| 183 * URL. | 183 * URL. |
| 184 */ | 184 */ |
| 185 onBeforeShow: function(data) { | 185 onBeforeShow: function(data) { |
| 186 var url = data.signin_url; | 186 var url = data.signin_url; |
| 187 if (data.gaiaOrigin) | 187 url += '?gaiaOrigin=' + encodeURIComponent(data.gaiaOrigin); |
| 188 url += '?gaiaOrigin=' + encodeURIComponent(data.gaiaOrigin); | 188 if (data.gaiaUrlBase) |
| 189 url += '&gaiaUrlPath=' + encodeURIComponent(data.gaiaUrlPath); |
| 189 if (data.test_email) { | 190 if (data.test_email) { |
| 190 url += '&test_email=' + encodeURIComponent(data.test_email); | 191 url += '&test_email=' + encodeURIComponent(data.test_email); |
| 191 url += '&test_password=' + encodeURIComponent(data.test_password); | 192 url += '&test_password=' + encodeURIComponent(data.test_password); |
| 192 } | 193 } |
| 193 this.signInUrl_ = url; | 194 this.signInUrl_ = url; |
| 194 this.setIsAutoEnrollment(data.is_auto_enrollment); | 195 this.setIsAutoEnrollment(data.is_auto_enrollment); |
| 195 | 196 |
| 196 $('oauth-enroll-signin-frame').contentWindow.location.href = | 197 $('oauth-enroll-signin-frame').contentWindow.location.href = |
| 197 this.signInUrl_; | 198 this.signInUrl_; |
| 198 | 199 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 var msg = m.data; | 304 var msg = m.data; |
| 304 if (msg.method == 'completeLogin' && this.isSigninMessage_(m)) | 305 if (msg.method == 'completeLogin' && this.isSigninMessage_(m)) |
| 305 chrome.send('oauthEnrollCompleteLogin', [ msg.email, msg.password ]); | 306 chrome.send('oauthEnrollCompleteLogin', [ msg.email, msg.password ]); |
| 306 } | 307 } |
| 307 }; | 308 }; |
| 308 | 309 |
| 309 return { | 310 return { |
| 310 OAuthEnrollmentScreen: OAuthEnrollmentScreen | 311 OAuthEnrollmentScreen: OAuthEnrollmentScreen |
| 311 }; | 312 }; |
| 312 }); | 313 }); |
| OLD | NEW |