OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 update screen implementation. | 6 * @fileoverview Oobe update screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('oobe', function() { | 9 cr.define('oobe', function() { |
10 /** | 10 /** |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 /** | 41 /** |
42 * Buttons in oobe wizard's button strip. | 42 * Buttons in oobe wizard's button strip. |
43 * @type {array} Array of Buttons. | 43 * @type {array} Array of Buttons. |
44 */ | 44 */ |
45 get buttons() { | 45 get buttons() { |
46 return null; | 46 return null; |
47 } | 47 } |
48 }; | 48 }; |
49 | 49 |
| 50 /** |
| 51 * Registers Escape accelerator to cancel update and |
| 52 * makes 'press Escape to cancel update' hint visible. |
| 53 */ |
50 UpdateScreen.enableUpdateCancel = function() { | 54 UpdateScreen.enableUpdateCancel = function() { |
51 $('update-cancel-hint').hidden = false; | 55 $('update-cancel-hint').hidden = false; |
52 document.addEventListener('keydown', function(e) { | 56 document.addEventListener('keydown', function(e) { |
53 if (e.keyCode == 27) { // Escape | 57 if (e.keyCode == 27) { // Escape |
54 var updateCancelHint = $('update-cancel-hint').children[0]; | 58 var updateCancelHint = $('update-cancel-hint').children[0]; |
55 updateCancelHint.textContent = | 59 updateCancelHint.textContent = |
56 localStrings.getString('cancelledUpdateMessage'); | 60 localStrings.getString('cancelledUpdateMessage'); |
57 chrome.send('cancelUpdate'); | 61 chrome.send('cancelUpdate'); |
58 } | 62 } |
59 }); | 63 }); |
60 }; | 64 }; |
61 | 65 |
62 return { | 66 return { |
63 UpdateScreen: UpdateScreen | 67 UpdateScreen: UpdateScreen |
64 }; | 68 }; |
65 }); | 69 }); |
OLD | NEW |