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

Unified Diff: remoting/webapp/crd/js/host_setup_dialog.js

Issue 898163002: Fix unable to opt-in to crash reports & usage statistics from web-app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 10 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/resources/remoting_strings.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_setup_dialog.js
diff --git a/remoting/webapp/crd/js/host_setup_dialog.js b/remoting/webapp/crd/js/host_setup_dialog.js
index 24097a19e6d528315043051623228f0c889ad201..8fb02de0230276e7b37b48cae4ed1d836a2a21aa 100644
--- a/remoting/webapp/crd/js/host_setup_dialog.js
+++ b/remoting/webapp/crd/js/host_setup_dialog.js
@@ -190,9 +190,21 @@ remoting.HostSetupDialog.prototype.showForStartWithToken_ =
* by policy.
*/
function onGetConsent(supported, allowed, set_by_policy) {
- that.usageStats_.hidden = !supported;
+ // Hide the usage stats check box if it is not supported or the policy
+ // doesn't allow usage stats collection.
+ var checkBoxLabel = that.usageStats_.querySelector('.checkbox-label');
+ that.usageStats_.hidden = !supported || (set_by_policy && !allowed);
that.usageStatsCheckbox_.checked = allowed;
+
that.usageStatsCheckbox_.disabled = set_by_policy;
+ checkBoxLabel.classList.toggle('disabled', set_by_policy);
+
+ if (set_by_policy) {
+ that.usageStats_.title = l10n.getTranslationOrError(
+ /*i18n-content*/ 'SETTING_MANAGED_BY_POLICY');
+ } else {
+ that.usageStats_.title = '';
+ }
}
/** @param {remoting.Error} error */
@@ -200,7 +212,7 @@ remoting.HostSetupDialog.prototype.showForStartWithToken_ =
console.error('Error getting consent status: ' + error);
}
- this.usageStats_.hidden = false;
+ this.usageStats_.hidden = true;
this.usageStatsCheckbox_.checked = false;
// Prevent user from ticking the box until the current consent status is
« no previous file with comments | « remoting/resources/remoting_strings.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698