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 /** | 5 /** |
6 * @fileoverview Oobe signin screen implementation. | 6 * @fileoverview Oobe signin screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 // Gaia loading time after which portal check should be fired. | 10 // Gaia loading time after which portal check should be fired. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // Offline sign-in is only allowed for the case when users aren't shown | 181 // Offline sign-in is only allowed for the case when users aren't shown |
182 // because there is no other way for an user to enter when device is | 182 // because there is no other way for an user to enter when device is |
183 // offline. | 183 // offline. |
184 this.isOfflineAllowed = !data.isShowUsers; | 184 this.isOfflineAllowed = !data.isShowUsers; |
185 | 185 |
186 this.updateAuthExtension_(data); | 186 this.updateAuthExtension_(data); |
187 | 187 |
188 var params = []; | 188 var params = []; |
189 if (data.gaiaOrigin) | 189 if (data.gaiaOrigin) |
190 params.push('gaiaOrigin=' + encodeURIComponent(data.gaiaOrigin)); | 190 params.push('gaiaOrigin=' + encodeURIComponent(data.gaiaOrigin)); |
| 191 if (data.gaiaUrlPath) |
| 192 params.push('gaiaUrlPath=' + encodeURIComponent(data.gaiaUrlPath)); |
191 if (data.hl) | 193 if (data.hl) |
192 params.push('hl=' + encodeURIComponent(data.hl)); | 194 params.push('hl=' + encodeURIComponent(data.hl)); |
193 if (data.localizedStrings) { | 195 if (data.localizedStrings) { |
194 var strings = data.localizedStrings; | 196 var strings = data.localizedStrings; |
195 for (var name in strings) { | 197 for (var name in strings) { |
196 params.push(name + '=' + encodeURIComponent(strings[name])); | 198 params.push(name + '=' + encodeURIComponent(strings[name])); |
197 } | 199 } |
198 } | 200 } |
199 if (data.email) | 201 if (data.email) |
200 params.push('email=' + encodeURIComponent(data.email)); | 202 params.push('email=' + encodeURIComponent(data.email)); |
201 if (data.test_email) | 203 if (data.test_email) |
202 params.push('test_email=' + encodeURIComponent(data.test_email)); | 204 params.push('test_email=' + encodeURIComponent(data.test_email)); |
203 if (data.test_password) | 205 if (data.test_password) |
204 params.push('test_password=' + encodeURIComponent(data.test_password)); | 206 params.push('test_password=' + encodeURIComponent(data.test_password)); |
205 | 207 |
206 var url = data.startUrl; | 208 var url = data.startUrl; |
207 if (params.length) | 209 if (params.length) |
208 url += '?' + params.join('&'); | 210 url += '?' + params.join('&'); |
209 | 211 |
210 if (data.forceReload || this.extensionUrl_ != url) { | 212 if (data.forceReload || this.extensionUrl_ != url) { |
211 console.log('Opening extension: ' + data.startUrl + | 213 console.log('Opening extension: ' + data.url + |
212 ', opt_email=' + data.email); | 214 ', opt_email=' + data.email); |
213 | 215 |
214 this.error_ = 0; | 216 this.error_ = 0; |
215 this.frame_.src = url; | 217 this.frame_.src = url; |
216 this.extensionUrl_ = url; | 218 this.extensionUrl_ = url; |
217 | 219 |
218 this.loading = true; | 220 this.loading = true; |
219 this.clearRetry_(); | 221 this.clearRetry_(); |
220 this.startLoadingTimer_(); | 222 this.startLoadingTimer_(); |
221 } else if (this.loading) { | 223 } else if (this.loading) { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 * @param {Object} data New extension parameters bag. | 427 * @param {Object} data New extension parameters bag. |
426 */ | 428 */ |
427 GaiaSigninScreen.updateAuthExtension = function(data) { | 429 GaiaSigninScreen.updateAuthExtension = function(data) { |
428 $('gaia-signin').updateAuthExtension_(data); | 430 $('gaia-signin').updateAuthExtension_(data); |
429 }; | 431 }; |
430 | 432 |
431 return { | 433 return { |
432 GaiaSigninScreen: GaiaSigninScreen | 434 GaiaSigninScreen: GaiaSigninScreen |
433 }; | 435 }; |
434 }); | 436 }); |
OLD | NEW |