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 Offline message screen implementation. | 6 * @fileoverview Offline message screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('ErrorMessageScreen', 'error-message', function() { | 9 login.createScreen('ErrorMessageScreen', 'error-message', function() { |
10 // Link which starts guest session for captive portal fixing. | 10 // Link which starts guest session for captive portal fixing. |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // The help topic linked from the auto enrollment error message. | 34 // The help topic linked from the auto enrollment error message. |
35 /** @const */ var HELP_TOPIC_AUTO_ENROLLMENT = 4632009; | 35 /** @const */ var HELP_TOPIC_AUTO_ENROLLMENT = 4632009; |
36 | 36 |
37 // Possible error states of the screen. | 37 // Possible error states of the screen. |
38 /** @const */ var ERROR_STATE = { | 38 /** @const */ var ERROR_STATE = { |
39 UNKNOWN: 'error-state-unknown', | 39 UNKNOWN: 'error-state-unknown', |
40 PORTAL: 'error-state-portal', | 40 PORTAL: 'error-state-portal', |
41 OFFLINE: 'error-state-offline', | 41 OFFLINE: 'error-state-offline', |
42 PROXY: 'error-state-proxy', | 42 PROXY: 'error-state-proxy', |
43 AUTH_EXT_TIMEOUT: 'error-state-auth-ext-timeout', | 43 AUTH_EXT_TIMEOUT: 'error-state-auth-ext-timeout' |
44 KIOSK_ONLINE: 'error-state-kiosk-online' | |
45 }; | 44 }; |
46 | 45 |
47 // Possible error states of the screen. Must be in the same order as | 46 // Possible error states of the screen. Must be in the same order as |
48 // ErrorScreen::ErrorState enum values. | 47 // ErrorScreen::ErrorState enum values. |
49 /** @const */ var ERROR_STATES = [ | 48 /** @const */ var ERROR_STATES = [ |
50 ERROR_STATE.UNKNOWN, | 49 ERROR_STATE.UNKNOWN, |
51 ERROR_STATE.PORTAL, | 50 ERROR_STATE.PORTAL, |
52 ERROR_STATE.OFFLINE, | 51 ERROR_STATE.OFFLINE, |
53 ERROR_STATE.PROXY, | 52 ERROR_STATE.PROXY, |
54 ERROR_STATE.AUTH_EXT_TIMEOUT, | 53 ERROR_STATE.AUTH_EXT_TIMEOUT |
55 ERROR_STATE.KIOSK_ONLINE | |
56 ]; | 54 ]; |
57 | 55 |
58 return { | 56 return { |
59 EXTERNAL_API: [ | 57 EXTERNAL_API: [ |
60 'updateLocalizedContent', | 58 'updateLocalizedContent', |
61 'onBeforeShow', | 59 'onBeforeShow', |
62 'onBeforeHide', | 60 'onBeforeHide', |
63 'allowGuestSignin', | 61 'allowGuestSignin', |
64 'allowOfflineLogin', | 62 'allowOfflineLogin', |
65 'setUIState', | 63 'setUIState', |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 219 |
222 var certsButton = this.ownerDocument.createElement('button'); | 220 var certsButton = this.ownerDocument.createElement('button'); |
223 certsButton.textContent = loadTimeData.getString('configureCertsButton'); | 221 certsButton.textContent = loadTimeData.getString('configureCertsButton'); |
224 certsButton.classList.add('show-with-ui-state-kiosk-mode'); | 222 certsButton.classList.add('show-with-ui-state-kiosk-mode'); |
225 certsButton.addEventListener('click', function(e) { | 223 certsButton.addEventListener('click', function(e) { |
226 chrome.send('configureCertsClicked'); | 224 chrome.send('configureCertsClicked'); |
227 e.stopPropagation(); | 225 e.stopPropagation(); |
228 }); | 226 }); |
229 buttons.push(certsButton); | 227 buttons.push(certsButton); |
230 | 228 |
231 var continueButton = this.ownerDocument.createElement('button'); | |
232 continueButton.id = 'continue-network-config-btn'; | |
233 continueButton.textContent = loadTimeData.getString('continueButton'); | |
234 continueButton.classList.add('show-with-error-state-kiosk-online'); | |
235 continueButton.addEventListener('click', function(e) { | |
236 chrome.send('continueAppLaunch'); | |
237 e.stopPropagation(); | |
238 }); | |
239 buttons.push(continueButton); | |
240 | |
241 var spacer = this.ownerDocument.createElement('div'); | 229 var spacer = this.ownerDocument.createElement('div'); |
242 spacer.classList.add('button-spacer'); | 230 spacer.classList.add('button-spacer'); |
243 spacer.classList.add('show-with-ui-state-kiosk-mode'); | 231 spacer.classList.add('show-with-ui-state-kiosk-mode'); |
244 buttons.push(spacer); | 232 buttons.push(spacer); |
245 | 233 |
246 var powerwashButton = this.ownerDocument.createElement('button'); | 234 var powerwashButton = this.ownerDocument.createElement('button'); |
247 powerwashButton.id = 'error-message-restart-and-powerwash-button'; | 235 powerwashButton.id = 'error-message-restart-and-powerwash-button'; |
248 powerwashButton.textContent = | 236 powerwashButton.textContent = |
249 loadTimeData.getString('localStateErrorPowerwashButton'); | 237 loadTimeData.getString('localStateErrorPowerwashButton'); |
250 powerwashButton.classList.add('show-with-ui-state-local-state-error'); | 238 powerwashButton.classList.add('show-with-ui-state-local-state-error'); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 /** | 338 /** |
351 * Updates visibility of the label indicating we're reconnecting. | 339 * Updates visibility of the label indicating we're reconnecting. |
352 * @param {boolean} show Whether the label should be shown. | 340 * @param {boolean} show Whether the label should be shown. |
353 */ | 341 */ |
354 showConnectingIndicator: function(show) { | 342 showConnectingIndicator: function(show) { |
355 this.classList.toggle('show-connecting-indicator', show); | 343 this.classList.toggle('show-connecting-indicator', show); |
356 this.onContentChange_(); | 344 this.onContentChange_(); |
357 } | 345 } |
358 }; | 346 }; |
359 }); | 347 }); |
OLD | NEW |