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

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: merge + closure 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
53 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
54 browserProxy.getMetricsReporting().then(boundSetMetricsReporting);
55
56 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.
57 </if>
36 }, 58 },
37 59
38 /** @protected */ 60 /** @protected */
39 currentRouteChanged: function() { 61 currentRouteChanged: function() {
40 this.showClearBrowsingDataDialog_ = 62 this.showClearBrowsingDataDialog_ =
41 settings.getCurrentRoute().dialog == 'clear-browsing-data'; 63 settings.getCurrentRoute().dialog == 'clear-browsing-data';
42 }, 64 },
43 65
44 /** @private */ 66 /** @private */
45 onManageCertificatesTap_: function() { 67 onManageCertificatesTap_: function() {
(...skipping 13 matching lines...) Expand all
59 81
60 /** @private */ 82 /** @private */
61 onClearBrowsingDataTap_: function() { 83 onClearBrowsingDataTap_: function() {
62 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); 84 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA);
63 }, 85 },
64 86
65 /** @private */ 87 /** @private */
66 onDialogClosed_: function() { 88 onDialogClosed_: function() {
67 settings.navigateTo(settings.Route.PRIVACY); 89 settings.navigateTo(settings.Route.PRIVACY);
68 }, 90 },
91
92 <if expr="_google_chrome and not chromeos">
93 /** @private */
94 onMetricsReportingCheckboxTap_: function() {
95 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance();
96 var enabled = this.$.metricsReportingCheckbox.checked;
97 browserProxy.setMetricsReportingEnabled(enabled);
98 },
99
100 /**
101 * @param {!MetricsReporting} metricsReporting
102 * @private
103 */
104 setMetricsReporting_: function(metricsReporting) {
105 this.metricsReporting_ = metricsReporting;
106 },
107 </if>
69 }); 108 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698