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

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

Issue 2233443002: MD Settings: implement metrics reporting checkbox on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@desktop-uma
Patch Set: remove 2 using Created 4 years, 4 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 1134a53be28525b4e8e2f16d129b68a38e78db3b..b8973df475b3daa00c1d9a7e0585e2352479c4c5 100644
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.js
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -10,7 +10,12 @@
Polymer({
is: 'settings-privacy-page',
- behaviors: [settings.RouteObserverBehavior],
+ behaviors: [
+ settings.RouteObserverBehavior,
+<if expr="_google_chrome and not chromeos">
+ WebUIListenerBehavior,
+</if>
+ ],
properties: {
/**
@@ -21,18 +26,34 @@ Polymer({
notify: true,
},
- /** @private */
- showClearBrowsingDataDialog_: Boolean,
-
/**
* Dictionary defining page visibility.
* @type {!PrivacyPageVisibility}
*/
pageVisibility: Object,
+
+<if expr="_google_chrome and not chromeos">
+ /** @type {MetricsReporting} */
+ metricsReporting_: Object,
+</if>
+
+ /** @private */
+ showClearBrowsingDataDialog_: {
+ computed: 'computeShowClearBrowsingDataDialog_(currentRoute)',
+ type: Boolean,
+ },
},
ready: function() {
this.ContentSettingsTypes = settings.ContentSettingsTypes;
+
+<if expr="_google_chrome and not chromeos">
+ var boundSetMetricsReporting = this.setMetricsReporting_.bind(this);
+ this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting);
+
+ var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
+ browserProxy.getMetricsReporting().then(boundSetMetricsReporting);
+</if>
},
/** @protected */
@@ -66,4 +87,21 @@ Polymer({
onDialogClosed_: function() {
settings.navigateTo(settings.Route.PRIVACY);
},
+
+<if expr="_google_chrome and not chromeos">
+ /** @private */
+ onMetricsReportingCheckboxTap_: function() {
+ var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
+ var enabled = this.$.metricsReportingCheckbox.checked;
+ browserProxy.setMetricsReportingEnabled(enabled);
+ },
+
+ /**
+ * @param {!MetricsReporting} metricsReporting
+ * @private
+ */
+ setMetricsReporting_: function(metricsReporting) {
+ this.metricsReporting_ = metricsReporting;
+ },
+</if>
});

Powered by Google App Engine
This is Rietveld 408576698