Chromium Code Reviews| Index: remoting/webapp/host_setup_dialog.js |
| diff --git a/remoting/webapp/host_setup_dialog.js b/remoting/webapp/host_setup_dialog.js |
| index 1e80910434f264103280808bec8e6d1f2fdef5bc..68a8ef2ccc963be684469df7914aba232c354c0a 100644 |
| --- a/remoting/webapp/host_setup_dialog.js |
| +++ b/remoting/webapp/host_setup_dialog.js |
| @@ -136,6 +136,10 @@ remoting.HostSetupDialog = function(hostController) { |
| this.pinEntry_.addEventListener('keypress', onDaemonPinEntryKeyPress, false); |
| this.pinEntry_.addEventListener('keypress', noDigitsInPin, false); |
| this.pinConfirm_.addEventListener('keypress', noDigitsInPin, false); |
| + |
| + this.usageStats_ = document.getElementById('usagestats-consent'); |
| + this.usageStatsCheckbox_ = |
| + document.getElementById('usagestats-consent-checkbox'); |
| }; |
| /** |
| @@ -145,6 +149,24 @@ remoting.HostSetupDialog = function(hostController) { |
| * @return {void} Nothing. |
| */ |
| remoting.HostSetupDialog.prototype.showForStart = function() { |
| + /** @type {remoting.HostSetupDialog} */ |
| + var that = this; |
| + |
| + /** |
| + * @param {boolean} supported True if crash dumps reporting is supported by |
|
Jamie
2012/06/21 18:47:52
Nit: s/dumps/dump/ here and elsewhere.
alexeypa (please no reviews)
2012/06/21 23:30:26
Done.
|
| + * the host. |
| + * @param {boolean} allowed True if crash dumps reporting is allowed. |
| + * @param {boolean} set_by_policy True if crash dump reporting is controlled |
| + * by policy. |
| + */ |
| + var onGetConsent = function(supported, allowed, set_by_policy) { |
| + that.usageStats_.hidden = !supported; |
| + that.usageStatsCheckbox_.checked = allowed; |
| + that.usageStatsCheckbox_.disabled = set_by_policy; |
| + }; |
| + this.usageStats_.hidden = true; |
|
Jamie
2012/06/21 18:47:52
Optional: I'm not sure hiding it and having it app
alexeypa (please no reviews)
2012/06/21 23:30:26
Done.
|
| + this.hostController_.getConsent(onGetConsent); |
| + |
| var flow = [ |
| remoting.HostSetupFlow.State.ASK_PIN, |
| remoting.HostSetupFlow.State.STARTING_HOST, |
| @@ -165,6 +187,7 @@ remoting.HostSetupDialog.prototype.showForStart = function() { |
| * @return {void} Nothing. |
| */ |
| remoting.HostSetupDialog.prototype.showForPin = function() { |
| + this.usageStats_.hidden = true; |
| this.startNewFlow_( |
| [remoting.HostSetupFlow.State.ASK_PIN, |
| remoting.HostSetupFlow.State.UPDATING_PIN, |
| @@ -296,7 +319,7 @@ remoting.HostSetupDialog.prototype.startHost_ = function() { |
| flow.switchToNextStep(result); |
| that.updateState_(); |
| } |
| - this.hostController_.start(this.flow_.pin, onHostStarted); |
| + this.hostController_.start(this.flow_.pin, this.flow_.consent, onHostStarted); |
| }; |
| remoting.HostSetupDialog.prototype.updatePin_ = function() { |
| @@ -367,6 +390,9 @@ remoting.HostSetupDialog.prototype.onPinSubmit_ = function() { |
| } |
| this.pinErrorDiv_.hidden = true; |
| this.flow_.pin = pin1; |
| + /** @type {boolean} */ |
| + var consent = !this.usageStats_.hidden && this.usageStatsCheckbox_.checked; |
| + this.flow_.consent = consent; |
| this.flow_.switchToNextStep(remoting.HostController.AsyncResult.OK); |
| this.updateState_(); |
| }; |