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 reset screen implementation. | 6 * @fileoverview Oobe reset screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('oobe', function() { | 9 cr.define('oobe', function() { |
10 /** | 10 /** |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 resetButton.textContent = localStrings.getString('resetButton'); | 50 resetButton.textContent = localStrings.getString('resetButton'); |
51 resetButton.addEventListener('click', function(e) { | 51 resetButton.addEventListener('click', function(e) { |
52 chrome.send('resetOnReset'); | 52 chrome.send('resetOnReset'); |
53 e.stopPropagation(); | 53 e.stopPropagation(); |
54 }); | 54 }); |
55 buttons.push(resetButton); | 55 buttons.push(resetButton); |
56 | 56 |
57 var cancelButton = this.ownerDocument.createElement('button'); | 57 var cancelButton = this.ownerDocument.createElement('button'); |
58 cancelButton.id = 'reset-cancel-button'; | 58 cancelButton.id = 'reset-cancel-button'; |
59 cancelButton.textContent = localStrings.getString('cancelButton'); | 59 cancelButton.textContent = localStrings.getString('cancelButton'); |
60 cancelButton.autofocus = true; | |
Nikita (slow)
2012/11/30 14:47:05
nit: is this still needed?
mtomasz
2012/11/30 18:35:31
Done.
| |
60 cancelButton.addEventListener('click', function(e) { | 61 cancelButton.addEventListener('click', function(e) { |
61 chrome.send('resetOnCancel'); | 62 chrome.send('resetOnCancel'); |
62 e.stopPropagation(); | 63 e.stopPropagation(); |
63 }); | 64 }); |
64 buttons.push(cancelButton); | 65 buttons.push(cancelButton); |
65 | 66 |
66 return buttons; | 67 return buttons; |
67 }, | 68 }, |
68 | 69 |
69 /** | 70 /** |
71 * Returns a control which should receive an initial focus. | |
72 */ | |
73 get defaultControl() { | |
74 return $('reset-cancel-button'); | |
75 }, | |
76 | |
77 /** | |
70 * Cancels the reset and drops the user back to the login screen. | 78 * Cancels the reset and drops the user back to the login screen. |
71 */ | 79 */ |
72 cancel: function() { | 80 cancel: function() { |
73 chrome.send('resetOnCancel'); | 81 chrome.send('resetOnCancel'); |
74 }, | 82 }, |
75 }; | 83 }; |
76 | 84 |
77 return { | 85 return { |
78 ResetScreen: ResetScreen | 86 ResetScreen: ResetScreen |
79 }; | 87 }; |
80 }); | 88 }); |
OLD | NEW |