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

Unified Diff: chrome/browser/resources/settings/privacy_page/privacy_page.js

Issue 2688073002: MD Settings: For rows containing paper-toggle-buttons, make entire row clickable. (Closed)
Patch Set: prevent clicking toggle from firing handler twice Created 3 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
Index: chrome/browser/resources/settings/privacy_page/privacy_page.js
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chrome/browser/resources/settings/privacy_page/privacy_page.js
index 8e0c4b029c5ad5253e57388a4c64b732355b14aa..35ccd677302507fd6f197f1bdebf7b0574e40794 100644
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.js
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -114,8 +114,11 @@ Polymer({
// <if expr="_google_chrome and not chromeos">
/** @private */
onMetricsReportingControlTap_: function() {
+ if(this.metricsReporting_.managed)
+ return;
+
var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
- var enabled = this.$.metricsReportingControl.checked;
+ var enabled = !this.metricsReporting_.enabled;
browserProxy.setMetricsReportingEnabled(enabled);
},
@@ -142,9 +145,9 @@ Polymer({
// </if>
/** @private */
- onSafeBrowsingExtendedReportingControlTap_: function() {
+ onSafeBrowsingExtendedReportingControlTap_: function(e) {
var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
- var enabled = this.$.safeBrowsingExtendedReportingControl.checked;
+ var enabled = !this.safeBrowsingExtendedReportingEnabled_;
Dan Beam 2017/02/10 17:20:36 i still don't really understand how this works. b
scottchen 2017/02/10 18:49:57 You're thinking of the toggle control's "checked"
browserProxy.setSafeBrowsingExtendedReportingEnabled(enabled);
},
@@ -184,4 +187,8 @@ Polymer({
getStringTernary_: function(value, trueLabel, falseLabel) {
return value ? trueLabel : falseLabel;
},
+
+ doNothing_: function(e) {
scottchen 2017/02/10 07:53:39 This is dipping into the "slightly gross" zone, bu
+ e.stopPropagation();
+ }
});

Powered by Google App Engine
This is Rietveld 408576698