OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 login.createScreen('AutolaunchScreen', 'autolaunch', function() { | 9 login.createScreen('AutolaunchScreen', 'autolaunch', function() { |
10 return { | 10 return { |
11 EXTERNAL_API: ['updateApp', 'confirmAutoLaunchForTesting'], | 11 EXTERNAL_API: ['updateApp', 'confirmAutoLaunchForTesting'], |
12 /** | 12 /** |
13 * Header text of the screen. | 13 * Header text of the screen. |
14 * @type {string} | 14 * @type {string} |
15 */ | 15 */ |
16 get header() { | 16 get header() { |
17 return loadTimeData.getString('autolaunchTitle'); | 17 return loadTimeData.getString('autolaunchTitle'); |
18 }, | 18 }, |
19 | 19 |
20 /** | 20 /** |
21 * Buttons in oobe wizard's button strip. | 21 * Buttons in oobe wizard's button strip. |
22 * @type {array} Array of Buttons. | 22 * @type {array} Array of Buttons. |
23 */ | 23 */ |
24 get buttons() { | 24 get buttons() { |
25 var buttons = []; | 25 var buttons = []; |
26 | 26 |
27 var confirmButton = this.ownerDocument.createElement('button'); | 27 var confirmButton = this.ownerDocument.createElement('button'); |
28 confirmButton.id = 'autolaunch-confirm-button'; | 28 confirmButton.id = 'autolaunch-confirm-button'; |
29 confirmButton.textContent = | 29 confirmButton.textContent = |
30 loadTimeData.getString('autolaunchConfirmButton'); | 30 loadTimeData.getString('autolaunchConfirmButton'); |
31 confirmButton.addEventListener('click', function(e) { | 31 confirmButton.addEventListener('click', function(e) { |
32 chrome.send('autolaunchOnConfirm'); | 32 chrome.send('autolaunchOnConfirm'); |
33 e.stopPropagation(); | 33 e.stopPropagation(); |
34 }); | 34 }); |
35 buttons.push(confirmButton); | 35 buttons.push(confirmButton); |
36 | 36 |
37 var cancelButton = this.ownerDocument.createElement('button'); | 37 var cancelButton = this.ownerDocument.createElement('button'); |
38 cancelButton.id = 'autolaunch-cancel-button'; | 38 cancelButton.id = 'autolaunch-cancel-button'; |
39 cancelButton.textContent = | 39 cancelButton.textContent = |
40 loadTimeData.getString('autolaunchCancelButton'); | 40 loadTimeData.getString('autolaunchCancelButton'); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 */ | 84 */ |
85 confirmAutoLaunchForTesting: function(confirm) { | 85 confirmAutoLaunchForTesting: function(confirm) { |
86 var button = confirm ? $('autolaunch-confirm-button') : | 86 var button = confirm ? $('autolaunch-confirm-button') : |
87 $('autolaunch-cancel-button'); | 87 $('autolaunch-cancel-button'); |
88 var clickEvent = cr.doc.createEvent('Event'); | 88 var clickEvent = cr.doc.createEvent('Event'); |
89 clickEvent.initEvent('click', true, true); | 89 clickEvent.initEvent('click', true, true); |
90 button.dispatchEvent(clickEvent); | 90 button.dispatchEvent(clickEvent); |
91 } | 91 } |
92 }; | 92 }; |
93 }); | 93 }); |
94 | |
95 | |
96 | |
OLD | NEW |