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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-privacy-page' is the settings page containing privacy and 7 * 'settings-privacy-page' is the settings page containing privacy and
8 * security settings. 8 * security settings.
9 */ 9 */
10 Polymer({ 10 Polymer({
11 is: 'settings-privacy-page', 11 is: 'settings-privacy-page',
12 12
13 behaviors: [settings.RouteObserverBehavior], 13 behaviors: [
14 settings.RouteObserverBehavior,
15 <if expr="_google_chrome and not chromeos">
16 WebUIListenerBehavior,
17 </if>
18 ],
14 19
15 properties: { 20 properties: {
16 /** 21 /**
17 * Preferences state. 22 * Preferences state.
18 */ 23 */
19 prefs: { 24 prefs: {
20 type: Object, 25 type: Object,
21 notify: true, 26 notify: true,
22 }, 27 },
23 28
24 /** @private */
25 showClearBrowsingDataDialog_: Boolean,
26
27 /** 29 /**
28 * Dictionary defining page visibility. 30 * Dictionary defining page visibility.
29 * @type {!PrivacyPageVisibility} 31 * @type {!PrivacyPageVisibility}
30 */ 32 */
31 pageVisibility: Object, 33 pageVisibility: Object,
34
35 <if expr="_google_chrome and not chromeos">
36 /** @type {MetricsReporting} */
37 metricsReporting_: Object,
38 </if>
39
40 /** @private */
41 showClearBrowsingDataDialog_: {
42 computed: 'computeShowClearBrowsingDataDialog_(currentRoute)',
43 type: Boolean,
44 },
32 }, 45 },
33 46
34 ready: function() { 47 ready: function() {
35 this.ContentSettingsTypes = settings.ContentSettingsTypes; 48 this.ContentSettingsTypes = settings.ContentSettingsTypes;
49
50 <if expr="_google_chrome and not chromeos">
51 var boundSetMetricsReporting = this.setMetricsReporting_.bind(this);
52 this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting);
53
54 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
55 browserProxy.getMetricsReporting().then(boundSetMetricsReporting);
56 </if>
36 }, 57 },
37 58
38 /** @protected */ 59 /** @protected */
39 currentRouteChanged: function() { 60 currentRouteChanged: function() {
40 this.showClearBrowsingDataDialog_ = 61 this.showClearBrowsingDataDialog_ =
41 settings.getCurrentRoute().dialog == 'clear-browsing-data'; 62 settings.getCurrentRoute().dialog == 'clear-browsing-data';
42 }, 63 },
43 64
44 /** @private */ 65 /** @private */
45 onManageCertificatesTap_: function() { 66 onManageCertificatesTap_: function() {
(...skipping 13 matching lines...) Expand all
59 80
60 /** @private */ 81 /** @private */
61 onClearBrowsingDataTap_: function() { 82 onClearBrowsingDataTap_: function() {
62 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); 83 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA);
63 }, 84 },
64 85
65 /** @private */ 86 /** @private */
66 onDialogClosed_: function() { 87 onDialogClosed_: function() {
67 settings.navigateTo(settings.Route.PRIVACY); 88 settings.navigateTo(settings.Route.PRIVACY);
68 }, 89 },
90
91 <if expr="_google_chrome and not chromeos">
92 /** @private */
93 onMetricsReportingCheckboxTap_: function() {
94 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
95 var enabled = this.$.metricsReportingCheckbox.checked;
96 browserProxy.setMetricsReportingEnabled(enabled);
97 },
98
99 /**
100 * @param {!MetricsReporting} metricsReporting
101 * @private
102 */
103 setMetricsReporting_: function(metricsReporting) {
104 this.metricsReporting_ = metricsReporting;
105 },
106 </if>
69 }); 107 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698