| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 An UI component to host gaia auth extension in an iframe. | 6 * @fileoverview An UI component to host gaia auth extension in an iframe. |
| 7 * After the component binds with an iframe, call its {@code load} to start the | 7 * After the component binds with an iframe, call its {@code load} to start the |
| 8 * authentication flow. There are two events would be raised after this point: | 8 * authentication flow. There are two events would be raised after this point: |
| 9 * a 'ready' event when the authentication UI is ready to use and a 'completed' | 9 * a 'ready' event when the authentication UI is ready to use and a 'completed' |
| 10 * event when the authentication is completed successfully. If caller is | 10 * event when the authentication is completed successfully. If caller is |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 for (var i in nameList) { | 246 for (var i in nameList) { |
| 247 var name = nameList[i]; | 247 var name = nameList[i]; |
| 248 if (values[name]) | 248 if (values[name]) |
| 249 params.push(name + '=' + encodeURIComponent(values[name])); | 249 params.push(name + '=' + encodeURIComponent(values[name])); |
| 250 } | 250 } |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 populateParams(SUPPORTED_PARAMS, data); | 253 populateParams(SUPPORTED_PARAMS, data); |
| 254 populateParams(LOCALIZED_STRING_PARAMS, data.localizedStrings); | 254 populateParams(LOCALIZED_STRING_PARAMS, data.localizedStrings); |
| 255 params.push('parentPage=' + encodeURIComponent(window.location.origin)); | 255 params.push('parentPage=' + encodeURIComponent(window.location.origin)); |
| 256 params.push('needPassword=1'); |
| 256 | 257 |
| 257 var url; | 258 var url; |
| 258 switch (authMode) { | 259 switch (authMode) { |
| 259 case AuthMode.OFFLINE: | 260 case AuthMode.OFFLINE: |
| 260 url = OFFLINE_AUTH_URL; | 261 url = OFFLINE_AUTH_URL; |
| 261 break; | 262 break; |
| 262 case AuthMode.DESKTOP: | 263 case AuthMode.DESKTOP: |
| 263 url = AUTH_URL; | 264 url = AUTH_URL; |
| 264 params.push('desktopMode=1'); | 265 params.push('desktopMode=1'); |
| 265 break; | 266 break; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 418 |
| 418 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 419 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
| 419 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; | 420 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; |
| 420 GaiaAuthHost.AuthMode = AuthMode; | 421 GaiaAuthHost.AuthMode = AuthMode; |
| 421 GaiaAuthHost.AuthFlow = AuthFlow; | 422 GaiaAuthHost.AuthFlow = AuthFlow; |
| 422 | 423 |
| 423 return { | 424 return { |
| 424 GaiaAuthHost: GaiaAuthHost | 425 GaiaAuthHost: GaiaAuthHost |
| 425 }; | 426 }; |
| 426 }); | 427 }); |
| OLD | NEW |