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 login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { | 9 login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
10 // Gaia loading time after which error message must be displayed and | 10 // Gaia loading time after which error message must be displayed and |
11 // lazy portal check should be fired. | 11 // lazy portal check should be fired. |
12 /** @const */ var GAIA_LOADING_PORTAL_SUSSPECT_TIME_SEC = 7; | 12 /** @const */ var GAIA_LOADING_PORTAL_SUSSPECT_TIME_SEC = 7; |
13 | 13 |
14 // Maximum Gaia loading time in seconds. | 14 // Maximum Gaia loading time in seconds. |
15 /** @const */ var MAX_GAIA_LOADING_TIME_SEC = 60; | 15 /** @const */ var MAX_GAIA_LOADING_TIME_SEC = 60; |
16 | 16 |
17 /** @const */ var HELP_TOPIC_ENTERPRISE_REPORTING = 2535613; | 17 /** @const */ var HELP_TOPIC_ENTERPRISE_REPORTING = 2535613; |
18 | 18 |
19 return { | 19 return { |
20 EXTERNAL_API: [ | 20 EXTERNAL_API: [ |
21 'loadAuthExtension', | 21 'loadAuthExtension', |
22 'updateAuthExtension', | 22 'updateAuthExtension', |
23 'doReload', | 23 'doReload', |
24 'onWebviewError', | 24 'onWebviewError', |
25 'onFrameError', | 25 'onFrameError', |
26 'updateCancelButtonState' | 26 'updateCancelButtonState', |
| 27 'showWhitelistCheckFailedError' |
27 ], | 28 ], |
28 | 29 |
29 /** | 30 /** |
30 * Frame loading error code (0 - no error). | 31 * Frame loading error code (0 - no error). |
31 * @type {number} | 32 * @type {number} |
32 * @private | 33 * @private |
33 */ | 34 */ |
34 error_: 0, | 35 error_: 0, |
35 | 36 |
36 /** | 37 /** |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 | 764 |
764 /** | 765 /** |
765 * Handler for webview error handling. | 766 * Handler for webview error handling. |
766 * @param {!Object} data Additional information about error event like: | 767 * @param {!Object} data Additional information about error event like: |
767 * {string} error Error code such as "ERR_INTERNET_DISCONNECTED". | 768 * {string} error Error code such as "ERR_INTERNET_DISCONNECTED". |
768 * {string} url The URL that failed to load. | 769 * {string} url The URL that failed to load. |
769 */ | 770 */ |
770 onWebviewError: function(data) { | 771 onWebviewError: function(data) { |
771 chrome.send('webviewLoadAborted', [data.error]); | 772 chrome.send('webviewLoadAborted', [data.error]); |
772 }, | 773 }, |
| 774 |
| 775 /** |
| 776 * Show/Hide error when user is not in whitelist. When UI is hidden |
| 777 * GAIA is reloaded. |
| 778 * @param {boolean} show Show/hide error UI. |
| 779 * @param {!Object} opt_data Optional additional information. |
| 780 */ |
| 781 showWhitelistCheckFailedError: function(show, opt_data) { |
| 782 if (opt_data) { |
| 783 $('gaia-whitelist-error').enterpriseManaged = |
| 784 opt_data.enterpriseManaged; |
| 785 } |
| 786 |
| 787 this.classList.toggle('whitelist-error', show); |
| 788 this.loading = !show; |
| 789 |
| 790 if (!show) |
| 791 Oobe.showSigninUI(); |
| 792 }, |
773 }; | 793 }; |
774 }); | 794 }); |
OLD | NEW |