| 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').addEventListener( |
| 21 'click', function(event) { | 21 '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').addEventListener( |
| 27 'click', function(event) { | 27 'click', function(event) { |
| 28 $('popup-overlay').hidden = true; | 28 $('popup-overlay').hidden = true; |
| 29 }); | 29 }); |
| 30 // Do not allow focus leaving the overlay. | |
| 31 $('popup-overlay').addEventListener('focusout', function(event) { | |
| 32 // WebKit does not allow immediate focus return. | |
| 33 window.setTimeout(function() { | |
| 34 // TODO(ivankr): focus cycling. | |
| 35 $('installation-settings-ok-button').focus(); | |
| 36 }, 0); | |
| 37 event.preventDefault(); | |
| 38 }); | |
| 39 | 30 |
| 40 var self = this; | 31 var self = this; |
| 41 $('usage-stats').addEventListener('click', function(event) { | 32 $('usage-stats').addEventListener('click', function(event) { |
| 42 self.onUsageStatsClicked_($('usage-stats').checked); | 33 self.onUsageStatsClicked_($('usage-stats').checked); |
| 43 event.stopPropagation(); | 34 event.stopPropagation(); |
| 44 }); | 35 }); |
| 45 $('oobe-eula-md').screen = this; | 36 $('oobe-eula-md').screen = this; |
| 46 }, | 37 }, |
| 47 | 38 |
| 48 /** | 39 /** |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if ($('cros-eula-frame').src) { | 151 if ($('cros-eula-frame').src) { |
| 161 $('cros-eula-frame').src = $('cros-eula-frame').src; | 152 $('cros-eula-frame').src = $('cros-eula-frame').src; |
| 162 } | 153 } |
| 163 if ($('oem-eula-frame').src) { | 154 if ($('oem-eula-frame').src) { |
| 164 $('oem-eula-frame').src = $('oem-eula-frame').src; | 155 $('oem-eula-frame').src = $('oem-eula-frame').src; |
| 165 } | 156 } |
| 166 }, | 157 }, |
| 167 }; | 158 }; |
| 168 }); | 159 }); |
| 169 | 160 |
| OLD | NEW |