Chromium Code Reviews| 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..a188ed91c37d32f6daefe9e4c3bbd013d1963a13 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,35 @@ 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); |
| + |
| + var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
| + browserProxy.getMetricsReporting().then(boundSetMetricsReporting); |
| + |
| + this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting); |
|
dschuyler
2016/08/10 18:55:16
Not even a nit, but just a preference: I know it
d
Dan Beam
2016/08/10 19:41:59
Done.
|
| +</if> |
| }, |
| /** @protected */ |
| @@ -66,4 +88,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> |
| }); |