| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 function loadAuthExtension(data) { | 56 function loadAuthExtension(data) { |
| 57 authExtHost.load(data.authMode, data, onAuthCompleted); | 57 authExtHost.load(data.authMode, data, onAuthCompleted); |
| 58 $('contents').classList.toggle('loading', | 58 $('contents').classList.toggle('loading', |
| 59 data.authMode != cr.login.GaiaAuthHost.AuthMode.DESKTOP); | 59 data.authMode != cr.login.GaiaAuthHost.AuthMode.DESKTOP); |
| 60 } | 60 } |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Closes the inline login dialog. | 63 * Closes the inline login dialog. |
| 64 */ | 64 */ |
| 65 function closeDialog() { | 65 function closeDialog() { |
| 66 chrome.send('DialogClose', ['']); | 66 chrome.send('dialogClose', ['']); |
| 67 } | 67 } |
| 68 | 68 |
| 69 /** | 69 /** |
| 70 * Invoked when failed to get oauth2 refresh token. | 70 * Invoked when failed to get oauth2 refresh token. |
| 71 */ | 71 */ |
| 72 function handleOAuth2TokenFailure() { | 72 function handleOAuth2TokenFailure() { |
| 73 // TODO(xiyuan): Show an error UI. | 73 // TODO(xiyuan): Show an error UI. |
| 74 authExtHost.reload(); | 74 authExtHost.reload(); |
| 75 $('contents').classList.toggle('loading', true); | 75 $('contents').classList.toggle('loading', true); |
| 76 } | 76 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 93 getAuthExtHost: getAuthExtHost, | 93 getAuthExtHost: getAuthExtHost, |
| 94 isAuthReady: isAuthReady, | 94 isAuthReady: isAuthReady, |
| 95 initialize: initialize, | 95 initialize: initialize, |
| 96 loadAuthExtension: loadAuthExtension, | 96 loadAuthExtension: loadAuthExtension, |
| 97 closeDialog: closeDialog, | 97 closeDialog: closeDialog, |
| 98 handleOAuth2TokenFailure: handleOAuth2TokenFailure | 98 handleOAuth2TokenFailure: handleOAuth2TokenFailure |
| 99 }; | 99 }; |
| 100 }); | 100 }); |
| 101 | 101 |
| 102 document.addEventListener('DOMContentLoaded', inline.login.initialize); | 102 document.addEventListener('DOMContentLoaded', inline.login.initialize); |
| OLD | NEW |