| 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 Inline login UI. | 6 * @fileoverview Inline login UI. |
| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Invoked when failed to get oauth2 refresh token. | 64 * Invoked when failed to get oauth2 refresh token. |
| 65 */ | 65 */ |
| 66 function handleOAuth2TokenFailure() { | 66 function handleOAuth2TokenFailure() { |
| 67 // TODO(xiyuan): Show an error UI. | 67 // TODO(xiyuan): Show an error UI. |
| 68 authExtHost.reload(); | 68 authExtHost.reload(); |
| 69 $('contents').classList.toggle('loading', true); | 69 $('contents').classList.toggle('loading', true); |
| 70 } | 70 } |
| 71 | 71 |
| 72 /** |
| 73 * Returns the auth host instance, for testing purpose. |
| 74 */ |
| 75 function getAuthExtHost() { |
| 76 return authExtHost; |
| 77 } |
| 78 |
| 72 return { | 79 return { |
| 80 getAuthExtHost: getAuthExtHost, |
| 73 initialize: initialize, | 81 initialize: initialize, |
| 74 loadAuthExtension: loadAuthExtension, | 82 loadAuthExtension: loadAuthExtension, |
| 75 closeDialog: closeDialog, | 83 closeDialog: closeDialog, |
| 76 handleOAuth2TokenFailure: handleOAuth2TokenFailure | 84 handleOAuth2TokenFailure: handleOAuth2TokenFailure |
| 77 }; | 85 }; |
| 78 }); | 86 }); |
| 79 | 87 |
| 80 document.addEventListener('DOMContentLoaded', inline.login.initialize); | 88 document.addEventListener('DOMContentLoaded', inline.login.initialize); |
| OLD | NEW |