| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 return; | 347 return; |
| 348 } | 348 } |
| 349 | 349 |
| 350 if (msg.method == 'reportState') { | 350 if (msg.method == 'reportState') { |
| 351 var newUrl = setQueryParam(location, 'frameUrl', msg.src); | 351 var newUrl = setQueryParam(location, 'frameUrl', msg.src); |
| 352 if (history.state) { | 352 if (history.state) { |
| 353 if (history.state.src != msg.src) { | 353 if (history.state.src != msg.src) { |
| 354 history.pushState({src: msg.src}, '', newUrl); | 354 history.pushState({src: msg.src}, '', newUrl); |
| 355 } | 355 } |
| 356 } else { | 356 } else { |
| 357 history.replaceState({src: msg.src}, '', newUrl); | 357 history.replaceState({src: msg.src}); |
| 358 } | 358 } |
| 359 return; | 359 return; |
| 360 } | 360 } |
| 361 | 361 |
| 362 if (msg.method == 'switchToFullTab') { | 362 if (msg.method == 'switchToFullTab') { |
| 363 chrome.send('switchToFullTab', [msg.url]); | 363 chrome.send('switchToFullTab', [msg.url]); |
| 364 return; | 364 return; |
| 365 } | 365 } |
| 366 | 366 |
| 367 console.error('Unknown message method=' + msg.method); | 367 console.error('Unknown message method=' + msg.method); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 391 | 391 |
| 392 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 392 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
| 393 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; | 393 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; |
| 394 GaiaAuthHost.AuthMode = AuthMode; | 394 GaiaAuthHost.AuthMode = AuthMode; |
| 395 GaiaAuthHost.AuthFlow = AuthFlow; | 395 GaiaAuthHost.AuthFlow = AuthFlow; |
| 396 | 396 |
| 397 return { | 397 return { |
| 398 GaiaAuthHost: GaiaAuthHost | 398 GaiaAuthHost: GaiaAuthHost |
| 399 }; | 399 }; |
| 400 }); | 400 }); |
| OLD | NEW |