OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Device disabled screen implementation. | 6 * @fileoverview Device disabled screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('DeviceDisabledScreen', 'device-disabled', function() { | 9 login.createScreen('DeviceDisabledScreen', 'device-disabled', function() { |
10 return { | 10 return { |
11 EXTERNAL_API: [ | 11 EXTERNAL_API: [ |
12 'setMessage' | 12 'setMessage' |
13 ], | 13 ], |
14 | 14 |
15 /** | 15 /** |
| 16 * Ignore any accelerators the user presses on this screen. |
| 17 */ |
| 18 ignoreAccelerators: true, |
| 19 |
| 20 /** |
16 * The visibility of the cancel button in the header bar is controlled by a | 21 * The visibility of the cancel button in the header bar is controlled by a |
17 * global. Although the device disabling screen hides the button, a | 22 * global. Although the device disabling screen hides the button, a |
18 * notification intended for an earlier screen (e.g animation finished) | 23 * notification intended for an earlier screen (e.g animation finished) |
19 * could re-show the button. If this happens, the current screen's cancel() | 24 * could re-show the button. If this happens, the current screen's cancel() |
20 * method will be shown when the user actually clicks the button. Make sure | 25 * method will be shown when the user actually clicks the button. Make sure |
21 * that this is a no-op. | 26 * that this is a no-op. |
22 */ | 27 */ |
23 cancel: function() { | 28 cancel: function() { |
24 }, | 29 }, |
25 | 30 |
26 /** | 31 /** |
27 * Event handler that is invoked just before the screen in shown. | 32 * Event handler that is invoked just before the screen in shown. |
28 */ | 33 */ |
29 onBeforeShow: function() { | 34 onBeforeShow: function() { |
30 $('progress-dots').hidden = true; | 35 $('progress-dots').hidden = true; |
31 var headerBar = $('login-header-bar'); | 36 var headerBar = $('login-header-bar'); |
32 headerBar.allowCancel = false; | 37 headerBar.allowCancel = false; |
33 headerBar.showGuestButton = false; | 38 headerBar.showGuestButton = false; |
34 headerBar.signinUIState = SIGNIN_UI_STATE.HIDDEN; | 39 headerBar.signinUIState = SIGNIN_UI_STATE.HIDDEN; |
35 }, | 40 }, |
36 | 41 |
37 /** | 42 /** |
38 * Sets the message to show to the user. | 43 * Sets the message to show to the user. |
39 * @param {string} message The message to show to the user. | 44 * @param {string} message The message to show to the user. |
40 * @private | 45 * @private |
41 */ | 46 */ |
42 setMessage: function(message) { | 47 setMessage: function(message) { |
| 48 // The contents of |message| is untrusted. Set it as |textContent| so that |
| 49 // it gets treated as plain text and cannot be used to inject JS or HTML. |
43 $('device-disabled-message').textContent = message; | 50 $('device-disabled-message').textContent = message; |
44 } | 51 } |
45 }; | 52 }; |
46 }); | 53 }); |
OLD | NEW |