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 login.createScreen('EulaScreen', 'eula', function() { | 9 login.createScreen('EulaScreen', 'eula', function() { |
10 var CONTEXT_KEY_USAGE_STATS_ENABLED = 'usageStatsEnabled'; | 10 var CONTEXT_KEY_USAGE_STATS_ENABLED = 'usageStatsEnabled'; |
11 | 11 |
12 return { | 12 return { |
13 /** @override */ | 13 /** @override */ |
14 decorate: function() { | 14 decorate: function() { |
15 $('eula-chrome-credits-link').hidden = true; | 15 $('eula-chrome-credits-link').hidden = true; |
16 $('eula-chromeos-credits-link').hidden = true; | 16 $('eula-chromeos-credits-link').hidden = true; |
17 $('stats-help-link').addEventListener('click', function(event) { | 17 $('stats-help-link').addEventListener('click', function(event) { |
18 chrome.send('eulaOnLearnMore'); | 18 chrome.send('eulaOnLearnMore'); |
19 }); | 19 }); |
20 $('installation-settings-link').addEventListener( | 20 $('installation-settings-link') |
21 'click', function(event) { | 21 .addEventListener('click', function(event) { |
22 chrome.send('eulaOnInstallationSettingsPopupOpened'); | 22 chrome.send('eulaOnInstallationSettingsPopupOpened'); |
23 $('popup-overlay').hidden = false; | 23 $('popup-overlay').hidden = false; |
24 $('installation-settings-ok-button').focus(); | 24 $('installation-settings-ok-button').focus(); |
25 }); | 25 }); |
26 $('installation-settings-ok-button').addEventListener( | 26 $('installation-settings-ok-button') |
27 'click', function(event) { | 27 .addEventListener('click', function(event) { |
28 $('popup-overlay').hidden = true; | 28 $('popup-overlay').hidden = true; |
29 }); | 29 }); |
30 | 30 |
31 var self = this; | 31 var self = this; |
32 $('usage-stats').addEventListener('click', function(event) { | 32 $('usage-stats').addEventListener('click', function(event) { |
33 self.onUsageStatsClicked_($('usage-stats').checked); | 33 self.onUsageStatsClicked_($('usage-stats').checked); |
34 event.stopPropagation(); | 34 event.stopPropagation(); |
35 }); | 35 }); |
36 $('oobe-eula-md').screen = this; | 36 $('oobe-eula-md').screen = this; |
37 }, | 37 }, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 if (loadTimeData.getString('newOobeUI') == 'on') | 111 if (loadTimeData.getString('newOobeUI') == 'on') |
112 return $('oobe-eula-md'); | 112 return $('oobe-eula-md'); |
113 | 113 |
114 return $('accept-button').disabled ? $('back-button') : | 114 return $('accept-button').disabled ? $('back-button') : |
115 $('accept-button'); | 115 $('accept-button'); |
116 }, | 116 }, |
117 | 117 |
118 enableKeyboardFlow: function() { | 118 enableKeyboardFlow: function() { |
119 $('eula-chrome-credits-link').hidden = false; | 119 $('eula-chrome-credits-link').hidden = false; |
120 $('eula-chromeos-credits-link').hidden = false; | 120 $('eula-chromeos-credits-link').hidden = false; |
121 $('eula-chrome-credits-link').addEventListener('click', | 121 $('eula-chrome-credits-link').addEventListener('click', function(event) { |
122 function(event) { | 122 chrome.send('eulaOnChromeCredits'); |
123 chrome.send('eulaOnChromeCredits'); | 123 }); |
124 }); | 124 $('eula-chromeos-credits-link') |
125 $('eula-chromeos-credits-link').addEventListener('click', | 125 .addEventListener('click', function(event) { |
126 function(event) { | |
127 chrome.send('eulaOnChromeOSCredits'); | 126 chrome.send('eulaOnChromeOSCredits'); |
128 }); | 127 }); |
129 }, | 128 }, |
130 | 129 |
131 /** | 130 /** |
132 * This method takes care of switching to material-design OOBE. | 131 * This method takes care of switching to material-design OOBE. |
133 * @private | 132 * @private |
134 */ | 133 */ |
135 setMDMode_: function() { | 134 setMDMode_: function() { |
136 var useMDOobe = (loadTimeData.getString('newOobeUI') == 'on'); | 135 var useMDOobe = (loadTimeData.getString('newOobeUI') == 'on'); |
(...skipping 13 matching lines...) Expand all Loading... |
150 // no access to iframe.contentWindow. | 149 // no access to iframe.contentWindow. |
151 if ($('cros-eula-frame').src) { | 150 if ($('cros-eula-frame').src) { |
152 $('cros-eula-frame').src = $('cros-eula-frame').src; | 151 $('cros-eula-frame').src = $('cros-eula-frame').src; |
153 } | 152 } |
154 if ($('oem-eula-frame').src) { | 153 if ($('oem-eula-frame').src) { |
155 $('oem-eula-frame').src = $('oem-eula-frame').src; | 154 $('oem-eula-frame').src = $('oem-eula-frame').src; |
156 } | 155 } |
157 }, | 156 }, |
158 }; | 157 }; |
159 }); | 158 }); |
160 | |
OLD | NEW |