Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: remoting/webapp/host_setup_dialog.js

Issue 10537182: The user's consent to crash dumps reporting can now be set via the UI (Windows only). The checkbox … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/host_plugin_proto.js ('k') | remoting/webapp/main.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fe60ecb15206983091020979215aa4213e5c8504 100644
--- a/remoting/webapp/host_setup_dialog.js
+++ b/remoting/webapp/host_setup_dialog.js
@@ -17,6 +17,7 @@ remoting.HostSetupFlow = function(sequence) {
this.currentStep_ = 0;
this.state_ = sequence[0];
this.pin = '';
+ this.consent = false;
};
/** @enum {number} */
@@ -136,6 +137,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 +150,25 @@ remoting.HostSetupDialog = function(hostController) {
* @return {void} Nothing.
*/
remoting.HostSetupDialog.prototype.showForStart = function() {
+ /** @type {remoting.HostSetupDialog} */
+ var that = this;
+
+ /**
+ * @param {boolean} supported True if crash dump reporting is supported by
+ * the host.
+ * @param {boolean} allowed True if crash dump 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 = false;
+ this.usageStatsCheckbox_.checked = true;
+ this.hostController_.getConsent(onGetConsent);
+
var flow = [
remoting.HostSetupFlow.State.ASK_PIN,
remoting.HostSetupFlow.State.STARTING_HOST,
@@ -165,6 +189,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 +321,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 +392,8 @@ remoting.HostSetupDialog.prototype.onPinSubmit_ = function() {
}
this.pinErrorDiv_.hidden = true;
this.flow_.pin = pin1;
+ this.flow_.consent = !this.usageStats_.hidden &&
+ (this.usageStatsCheckbox_.value == "on");
this.flow_.switchToNextStep(remoting.HostController.AsyncResult.OK);
this.updateState_();
};
« no previous file with comments | « remoting/webapp/host_plugin_proto.js ('k') | remoting/webapp/main.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698