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 eula screen implementation. | 6 * @fileoverview Oobe eula screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('oobe', function() { | 9 cr.define('oobe', function() { |
10 /** | 10 /** |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 * Buttons in oobe wizard's button strip. | 64 * Buttons in oobe wizard's button strip. |
65 * @type {array} Array of Buttons. | 65 * @type {array} Array of Buttons. |
66 */ | 66 */ |
67 get buttons() { | 67 get buttons() { |
68 var buttons = []; | 68 var buttons = []; |
69 | 69 |
70 var backButton = this.ownerDocument.createElement('button'); | 70 var backButton = this.ownerDocument.createElement('button'); |
71 backButton.id = 'back-button'; | 71 backButton.id = 'back-button'; |
72 backButton.textContent = localStrings.getString('back'); | 72 backButton.textContent = localStrings.getString('back'); |
73 backButton.addEventListener('click', function(e) { | 73 backButton.addEventListener('click', function(e) { |
74 chrome.send('eulaOnExit', | 74 chrome.send('eulaOnExit', [false, $('usage-stats').checked]); |
75 [false, $('usage-stats').checked, $('rlz-enable').checked]); | |
76 e.stopPropagation(); | 75 e.stopPropagation(); |
77 }); | 76 }); |
78 buttons.push(backButton); | 77 buttons.push(backButton); |
79 | 78 |
80 var acceptButton = this.ownerDocument.createElement('button'); | 79 var acceptButton = this.ownerDocument.createElement('button'); |
81 acceptButton.id = 'accept-button'; | 80 acceptButton.id = 'accept-button'; |
82 acceptButton.textContent = localStrings.getString('acceptAgreement'); | 81 acceptButton.textContent = localStrings.getString('acceptAgreement'); |
83 acceptButton.addEventListener('click', function(e) { | 82 acceptButton.addEventListener('click', function(e) { |
84 $('eula').classList.add('loading'); // Mark EULA screen busy. | 83 $('eula').classList.add('loading'); // Mark EULA screen busy. |
85 chrome.send('eulaOnExit', | 84 chrome.send('eulaOnExit', [true, $('usage-stats').checked]); |
86 [true, $('usage-stats').checked, $('rlz-enable').checked]); | |
87 e.stopPropagation(); | 85 e.stopPropagation(); |
88 }); | 86 }); |
89 buttons.push(acceptButton); | 87 buttons.push(acceptButton); |
90 | 88 |
91 return buttons; | 89 return buttons; |
92 }, | 90 }, |
93 | 91 |
94 /** | 92 /** |
95 * Returns a control which should receive an initial focus. | 93 * Returns a control which should receive an initial focus. |
96 */ | 94 */ |
97 get defaultControl() { | 95 get defaultControl() { |
98 return $('accept-button'); | 96 return $('accept-button'); |
99 }, | 97 }, |
100 | 98 |
101 /** | 99 /** |
102 * Updates localized content of the screen that is not updated via template. | 100 * Updates localized content of the screen that is not updated via template. |
103 */ | 101 */ |
104 updateLocalizedContent: function() { | 102 updateLocalizedContent: function() { |
105 if ($('cros-eula-frame').src != '') | 103 if ($('cros-eula-frame').src != '') |
106 $('cros-eula-frame').src = $('cros-eula-frame').src; | 104 $('cros-eula-frame').src = $('cros-eula-frame').src; |
107 if ($('oem-eula-frame').src != '') | 105 if ($('oem-eula-frame').src != '') |
108 $('oem-eula-frame').src = $('oem-eula-frame').src; | 106 $('oem-eula-frame').src = $('oem-eula-frame').src; |
109 } | 107 } |
110 }; | 108 }; |
111 | 109 |
112 return { | 110 return { |
113 EulaScreen: EulaScreen | 111 EulaScreen: EulaScreen |
114 }; | 112 }; |
115 }); | 113 }); |
OLD | NEW |