Chromium Code Reviews| 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'; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 // WebKit does not allow immediate focus return. | 32 // WebKit does not allow immediate focus return. |
| 33 window.setTimeout(function() { | 33 window.setTimeout(function() { |
| 34 // TODO(ivankr): focus cycling. | 34 // TODO(ivankr): focus cycling. |
| 35 $('installation-settings-ok-button').focus(); | 35 $('installation-settings-ok-button').focus(); |
| 36 }, 0); | 36 }, 0); |
| 37 event.preventDefault(); | 37 event.preventDefault(); |
| 38 }); | 38 }); |
| 39 | 39 |
| 40 var self = this; | 40 var self = this; |
| 41 $('usage-stats').addEventListener('click', function(event) { | 41 $('usage-stats').addEventListener('click', function(event) { |
| 42 self.context.set(CONTEXT_KEY_USAGE_STATS_ENABLED, | 42 self.onUsageStatsClicked_($('usage-stats').checked); |
| 43 $('usage-stats').checked); | |
| 44 self.commitContextChanges(); | |
| 45 event.stopPropagation(); | 43 event.stopPropagation(); |
| 46 }); | 44 }); |
|
stevenjb
2016/08/23 16:45:17
The data-binding way to do this would be in the ht
Alexander Alekseev
2016/08/25 01:28:22
This doesn't work, because usage-stats is not a po
stevenjb
2016/08/25 16:43:46
I see. I get confused by the mix of polymer/non-po
| |
| 45 $('oobe-eula-md').screen = this; | |
| 46 }, | |
| 47 | |
| 48 /* | |
|
stevenjb
2016/08/23 16:45:17
/**
Alexander Alekseev
2016/08/25 01:28:22
Done.
| |
| 49 * Event handler for $('usage-stats') click event. | |
| 50 * @param {boolean} value $('usage-stats').checked value. | |
|
stevenjb
2016/08/23 16:45:17
align
Alexander Alekseev
2016/08/25 01:28:22
Done.
| |
| 51 */ | |
| 52 onUsageStatsClicked_: function(value) { | |
| 53 this.context.set(CONTEXT_KEY_USAGE_STATS_ENABLED, value); | |
| 54 this.commitContextChanges(); | |
| 47 }, | 55 }, |
| 48 | 56 |
| 49 /** | 57 /** |
| 50 * Event handler that is invoked when 'chrome://terms' is loaded. | 58 * Event handler that is invoked when 'chrome://terms' is loaded. |
| 51 */ | 59 */ |
| 52 onFrameLoad: function() { | 60 onFrameLoad: function() { |
| 53 $('accept-button').disabled = false; | 61 $('accept-button').disabled = false; |
| 54 $('eula').classList.remove('eula-loading'); | 62 $('eula').classList.remove('eula-loading'); |
| 55 // Initially, the back button is focused and the accept button is | 63 // Initially, the back button is focused and the accept button is |
| 56 // disabled. | 64 // disabled. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 if ($('cros-eula-frame').src) { | 144 if ($('cros-eula-frame').src) { |
| 137 $('cros-eula-frame').src = $('cros-eula-frame').src; | 145 $('cros-eula-frame').src = $('cros-eula-frame').src; |
| 138 } | 146 } |
| 139 if ($('oem-eula-frame').src) { | 147 if ($('oem-eula-frame').src) { |
| 140 $('oem-eula-frame').src = $('oem-eula-frame').src; | 148 $('oem-eula-frame').src = $('oem-eula-frame').src; |
| 141 } | 149 } |
| 142 } | 150 } |
| 143 }; | 151 }; |
| 144 }); | 152 }); |
| 145 | 153 |
| OLD | NEW |