| 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 <include src="../../gaia_auth_host/gaia_auth_host.js"></include> | 9 <include src="../../gaia_auth_host/gaia_auth_host.js"></include> |
| 10 | 10 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 var params = {}; | 249 var params = {}; |
| 250 for (var i in cr.login.GaiaAuthHost.SUPPORTED_PARAMS) { | 250 for (var i in cr.login.GaiaAuthHost.SUPPORTED_PARAMS) { |
| 251 var name = cr.login.GaiaAuthHost.SUPPORTED_PARAMS[i]; | 251 var name = cr.login.GaiaAuthHost.SUPPORTED_PARAMS[i]; |
| 252 if (data[name]) | 252 if (data[name]) |
| 253 params[name] = data[name]; | 253 params[name] = data[name]; |
| 254 } | 254 } |
| 255 | 255 |
| 256 if (data.localizedStrings) | 256 if (data.localizedStrings) |
| 257 params.localizedStrings = data.localizedStrings; | 257 params.localizedStrings = data.localizedStrings; |
| 258 | 258 |
| 259 if (data.useEmbedded) |
| 260 params.gaiaPath = 'EmbeddedSignIn'; |
| 261 |
| 259 if (data.forceReload || | 262 if (data.forceReload || |
| 260 JSON.stringify(this.gaiaAuthParams_) != JSON.stringify(params)) { | 263 JSON.stringify(this.gaiaAuthParams_) != JSON.stringify(params)) { |
| 261 this.error_ = 0; | 264 this.error_ = 0; |
| 262 this.gaiaAuthHost_.load(data.useOffline ? | 265 |
| 263 cr.login.GaiaAuthHost.AuthMode.OFFLINE : | 266 var authMode = cr.login.GaiaAuthHost.AuthMode.DEFAULT; |
| 264 cr.login.GaiaAuthHost.AuthMode.DEFAULT, | 267 if (data.useOffline) |
| 268 authMode = cr.login.GaiaAuthHost.AuthMode.OFFLINE; |
| 269 else if (data.useEmbedded) |
| 270 authMode = cr.login.GaiaAuthHost.AuthMode.DESKTOP; |
| 271 |
| 272 this.gaiaAuthHost_.load(authMode, |
| 265 params, | 273 params, |
| 266 this.onAuthCompleted_.bind(this)); | 274 this.onAuthCompleted_.bind(this)); |
| 267 this.gaiaAuthParams_ = params; | 275 this.gaiaAuthParams_ = params; |
| 268 | 276 |
| 269 this.loading = true; | 277 this.loading = true; |
| 270 this.startLoadingTimer_(); | 278 this.startLoadingTimer_(); |
| 271 } else if (this.loading && this.error_) { | 279 } else if (this.loading && this.error_) { |
| 272 // An error has occurred, so trying to reload. | 280 // An error has occurred, so trying to reload. |
| 273 this.doReload(); | 281 this.doReload(); |
| 274 } | 282 } |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 * For more info see C++ class 'WebUILoginView' which calls this method. | 628 * For more info see C++ class 'WebUILoginView' which calls this method. |
| 621 * @param {number} error Error code. | 629 * @param {number} error Error code. |
| 622 * @param {string} url The URL that failed to load. | 630 * @param {string} url The URL that failed to load. |
| 623 */ | 631 */ |
| 624 onFrameError: function(error, url) { | 632 onFrameError: function(error, url) { |
| 625 this.error_ = error; | 633 this.error_ = error; |
| 626 chrome.send('frameLoadingCompleted', [this.error_]); | 634 chrome.send('frameLoadingCompleted', [this.error_]); |
| 627 }, | 635 }, |
| 628 }; | 636 }; |
| 629 }); | 637 }); |
| OLD | NEW |