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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 return; // Otherwise the "submit" action can't be triggered by Enter. | 129 return; // Otherwise the "submit" action can't be triggered by Enter. |
130 } | 130 } |
131 if ((event.which >= 48) && (event.which <= 57)) { | 131 if ((event.which >= 48) && (event.which <= 57)) { |
132 return; | 132 return; |
133 } | 133 } |
134 event.preventDefault(); | 134 event.preventDefault(); |
135 }; | 135 }; |
136 this.pinEntry_.addEventListener('keypress', onDaemonPinEntryKeyPress, false); | 136 this.pinEntry_.addEventListener('keypress', onDaemonPinEntryKeyPress, false); |
137 this.pinEntry_.addEventListener('keypress', noDigitsInPin, false); | 137 this.pinEntry_.addEventListener('keypress', noDigitsInPin, false); |
138 this.pinConfirm_.addEventListener('keypress', noDigitsInPin, false); | 138 this.pinConfirm_.addEventListener('keypress', noDigitsInPin, false); |
139 | |
140 this.usageStatsConsent_ = document.getElementById('usagestats-consent'); | |
141 | |
142 /** | |
143 * @param {boolean} set_by_policy True if crash dump reporting is allowed by | |
Jamie
2012/06/14 23:43:56
s/allowed/controlled/ (it might be disabled by pol
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
144 * the policy. | |
Jamie
2012/06/14 23:43:56
s/the//
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
145 * @param {boolean} allowed True if crash dumps reporting is allowed. | |
146 */ | |
147 var onGetConsent = function(set_by_policy, allowed) { | |
148 that.usageStatsConsent_.disabled = set_by_policy; | |
149 that.usageStatsConsent_.checked = allowed; | |
150 } | |
151 this.hostController_.getConsent(onGetConsent); | |
Jamie
2012/06/14 23:43:56
This belongs in showForStart. I suspect it won't m
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
152 | |
153 /** @param {boolean} Whether the consent checkbox is selected. */ | |
154 var onConsentChange = function(checked) { | |
155 that.hostController_.setConsent(checked); | |
156 }; | |
157 this.usageStatsConsent_.onchange = function() { | |
158 onConsentChange(this.checked); | |
159 }; | |
Jamie
2012/06/14 23:43:56
I think this would be better handled by deferring
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
139 }; | 160 }; |
140 | 161 |
141 /** | 162 /** |
142 * Show the dialog in order to get a PIN prior to starting the daemon. When the | 163 * Show the dialog in order to get a PIN prior to starting the daemon. When the |
143 * user clicks OK, the dialog shows a spinner until the daemon has started. | 164 * user clicks OK, the dialog shows a spinner until the daemon has started. |
144 * | 165 * |
145 * @return {void} Nothing. | 166 * @return {void} Nothing. |
146 */ | 167 */ |
147 remoting.HostSetupDialog.prototype.showForStart = function() { | 168 remoting.HostSetupDialog.prototype.showForStart = function() { |
Jamie
2012/06/14 23:43:56
showForStart should show the check-box if crash re
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
148 var flow = [ | 169 var flow = [ |
149 remoting.HostSetupFlow.State.ASK_PIN, | 170 remoting.HostSetupFlow.State.ASK_PIN, |
150 remoting.HostSetupFlow.State.STARTING_HOST, | 171 remoting.HostSetupFlow.State.STARTING_HOST, |
151 remoting.HostSetupFlow.State.HOST_STARTED]; | 172 remoting.HostSetupFlow.State.HOST_STARTED]; |
152 | 173 |
153 if (navigator.platform.indexOf('Mac') != -1 && | 174 if (navigator.platform.indexOf('Mac') != -1 && |
154 this.hostController_.state() == | 175 this.hostController_.state() == |
155 remoting.HostController.State.NOT_INSTALLED) { | 176 remoting.HostController.State.NOT_INSTALLED) { |
156 flow.unshift(remoting.HostSetupFlow.State.INSTALL_HOST); | 177 flow.unshift(remoting.HostSetupFlow.State.INSTALL_HOST); |
157 } | 178 } |
158 | 179 |
159 this.startNewFlow_(flow); | 180 this.startNewFlow_(flow); |
160 }; | 181 }; |
161 | 182 |
162 /** | 183 /** |
163 * Show the dialog in order to change the PIN associated with a running daemon. | 184 * Show the dialog in order to change the PIN associated with a running daemon. |
164 * | 185 * |
165 * @return {void} Nothing. | 186 * @return {void} Nothing. |
166 */ | 187 */ |
167 remoting.HostSetupDialog.prototype.showForPin = function() { | 188 remoting.HostSetupDialog.prototype.showForPin = function() { |
Jamie
2012/06/14 23:43:56
showForPin should hide the check-box. I don't thin
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
168 this.startNewFlow_( | 189 this.startNewFlow_( |
169 [remoting.HostSetupFlow.State.ASK_PIN, | 190 [remoting.HostSetupFlow.State.ASK_PIN, |
170 remoting.HostSetupFlow.State.UPDATING_PIN, | 191 remoting.HostSetupFlow.State.UPDATING_PIN, |
171 remoting.HostSetupFlow.State.UPDATED_PIN]); | 192 remoting.HostSetupFlow.State.UPDATED_PIN]); |
172 }; | 193 }; |
173 | 194 |
174 /** | 195 /** |
175 * Show the dialog in order to stop the daemon. | 196 * Show the dialog in order to stop the daemon. |
176 * | 197 * |
177 * @return {void} Nothing. | 198 * @return {void} Nothing. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 | 434 |
414 /** | 435 /** |
415 * @return {void} Nothing. | 436 * @return {void} Nothing. |
416 */ | 437 */ |
417 remoting.HostSetupDialog.prototype.onInstallDialogRetry = function() { | 438 remoting.HostSetupDialog.prototype.onInstallDialogRetry = function() { |
418 remoting.setMode(remoting.AppMode.HOST_SETUP_INSTALL); | 439 remoting.setMode(remoting.AppMode.HOST_SETUP_INSTALL); |
419 } | 440 } |
420 | 441 |
421 /** @type {remoting.HostSetupDialog} */ | 442 /** @type {remoting.HostSetupDialog} */ |
422 remoting.hostSetupDialog = null; | 443 remoting.hostSetupDialog = null; |
OLD | NEW |