OLD | NEW |
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({ |
(...skipping 12 matching lines...) Expand all Loading... |
23 type: Object, | 23 type: Object, |
24 notify: true, | 24 notify: true, |
25 }, | 25 }, |
26 | 26 |
27 /** | 27 /** |
28 * Dictionary defining page visibility. | 28 * Dictionary defining page visibility. |
29 * @type {!PrivacyPageVisibility} | 29 * @type {!PrivacyPageVisibility} |
30 */ | 30 */ |
31 pageVisibility: Object, | 31 pageVisibility: Object, |
32 | 32 |
33 <if expr="_google_chrome and not chromeos"> | 33 // <if expr="_google_chrome and not chromeos"> |
34 /** @type {MetricsReporting} */ | 34 /** @type {MetricsReporting} */ |
35 metricsReporting_: Object, | 35 metricsReporting_: Object, |
36 | 36 |
37 showRestart_: Boolean, | 37 showRestart_: Boolean, |
38 </if> | 38 // </if> |
39 | 39 |
40 /** @private */ | 40 /** @private */ |
41 safeBrowsingExtendedReportingEnabled_: Boolean, | 41 safeBrowsingExtendedReportingEnabled_: Boolean, |
42 | 42 |
43 /** @private */ | 43 /** @private */ |
44 showClearBrowsingDataDialog_: Boolean, | 44 showClearBrowsingDataDialog_: Boolean, |
45 }, | 45 }, |
46 | 46 |
47 ready: function() { | 47 ready: function() { |
48 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 48 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
49 | 49 |
50 <if expr="_google_chrome and not chromeos"> | 50 // <if expr="_google_chrome and not chromeos"> |
51 var boundSetMetricsReporting = this.setMetricsReporting_.bind(this); | 51 var boundSetMetricsReporting = this.setMetricsReporting_.bind(this); |
52 this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting); | 52 this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting); |
53 | 53 |
54 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); | 54 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
55 browserProxy.getMetricsReporting().then(boundSetMetricsReporting); | 55 browserProxy.getMetricsReporting().then(boundSetMetricsReporting); |
56 </if> | 56 // </if> |
57 | 57 |
58 var boundSetSber = this.setSafeBrowsingExtendedReporting_.bind(this); | 58 var boundSetSber = this.setSafeBrowsingExtendedReporting_.bind(this); |
59 this.addWebUIListener('safe-browsing-extended-reporting-change', | 59 this.addWebUIListener('safe-browsing-extended-reporting-change', |
60 boundSetSber); | 60 boundSetSber); |
61 settings.PrivacyPageBrowserProxyImpl.getInstance() | 61 settings.PrivacyPageBrowserProxyImpl.getInstance() |
62 .getSafeBrowsingExtendedReporting().then(boundSetSber); | 62 .getSafeBrowsingExtendedReporting().then(boundSetSber); |
63 }, | 63 }, |
64 | 64 |
65 /** @protected */ | 65 /** @protected */ |
66 currentRouteChanged: function() { | 66 currentRouteChanged: function() { |
67 this.showClearBrowsingDataDialog_ = | 67 this.showClearBrowsingDataDialog_ = |
68 settings.getCurrentRoute() == settings.Route.CLEAR_BROWSER_DATA; | 68 settings.getCurrentRoute() == settings.Route.CLEAR_BROWSER_DATA; |
69 }, | 69 }, |
70 | 70 |
71 /** @private */ | 71 /** @private */ |
72 onManageCertificatesTap_: function() { | 72 onManageCertificatesTap_: function() { |
73 <if expr="use_nss_certs"> | 73 // <if expr="use_nss_certs"> |
74 settings.navigateTo(settings.Route.CERTIFICATES); | 74 settings.navigateTo(settings.Route.CERTIFICATES); |
75 </if> | 75 // </if> |
76 <if expr="is_win or is_macosx"> | 76 // <if expr="is_win or is_macosx"> |
77 settings.PrivacyPageBrowserProxyImpl.getInstance(). | 77 settings.PrivacyPageBrowserProxyImpl.getInstance(). |
78 showManageSSLCertificates(); | 78 showManageSSLCertificates(); |
79 </if> | 79 // </if> |
80 }, | 80 }, |
81 | 81 |
82 /** | 82 /** |
83 * This is a workaround to connect the remove all button to the subpage. | 83 * This is a workaround to connect the remove all button to the subpage. |
84 * @private | 84 * @private |
85 */ | 85 */ |
86 onRemoveAllCookiesFromSite_: function() { | 86 onRemoveAllCookiesFromSite_: function() { |
87 var node = /** @type {?SiteDataDetailsSubpageElement} */(this.$$( | 87 var node = /** @type {?SiteDataDetailsSubpageElement} */(this.$$( |
88 'site-data-details-subpage')); | 88 'site-data-details-subpage')); |
89 if (node) | 89 if (node) |
(...skipping 14 matching lines...) Expand all Loading... |
104 onDialogClosed_: function() { | 104 onDialogClosed_: function() { |
105 settings.navigateToPreviousRoute(); | 105 settings.navigateToPreviousRoute(); |
106 }, | 106 }, |
107 | 107 |
108 /** @private */ | 108 /** @private */ |
109 onHelpTap_: function() { | 109 onHelpTap_: function() { |
110 window.open( | 110 window.open( |
111 'https://support.google.com/chrome/?p=settings_manage_exceptions'); | 111 'https://support.google.com/chrome/?p=settings_manage_exceptions'); |
112 }, | 112 }, |
113 | 113 |
114 <if expr="_google_chrome and not chromeos"> | 114 // <if expr="_google_chrome and not chromeos"> |
115 /** @private */ | 115 /** @private */ |
116 onMetricsReportingCheckboxTap_: function() { | 116 onMetricsReportingCheckboxTap_: function() { |
117 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); | 117 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
118 var enabled = this.$.metricsReportingCheckbox.checked; | 118 var enabled = this.$.metricsReportingCheckbox.checked; |
119 browserProxy.setMetricsReportingEnabled(enabled); | 119 browserProxy.setMetricsReportingEnabled(enabled); |
120 }, | 120 }, |
121 | 121 |
122 /** | 122 /** |
123 * @param {!MetricsReporting} metricsReporting | 123 * @param {!MetricsReporting} metricsReporting |
124 * @private | 124 * @private |
125 */ | 125 */ |
126 setMetricsReporting_: function(metricsReporting) { | 126 setMetricsReporting_: function(metricsReporting) { |
127 // TODO(dbeam): remember whether metrics reporting was enabled when Chrome | 127 // TODO(dbeam): remember whether metrics reporting was enabled when Chrome |
128 // started. | 128 // started. |
129 if (metricsReporting.managed) { | 129 if (metricsReporting.managed) { |
130 this.showRestart_ = false; | 130 this.showRestart_ = false; |
131 } else if (this.metricsReporting_ && | 131 } else if (this.metricsReporting_ && |
132 metricsReporting.enabled != this.metricsReporting_.enabled) { | 132 metricsReporting.enabled != this.metricsReporting_.enabled) { |
133 this.showRestart_ = true; | 133 this.showRestart_ = true; |
134 } | 134 } |
135 this.metricsReporting_ = metricsReporting; | 135 this.metricsReporting_ = metricsReporting; |
136 }, | 136 }, |
137 | 137 |
138 /** @private */ | 138 /** @private */ |
139 onRestartTap_: function() { | 139 onRestartTap_: function() { |
140 settings.LifetimeBrowserProxyImpl.getInstance().restart(); | 140 settings.LifetimeBrowserProxyImpl.getInstance().restart(); |
141 }, | 141 }, |
142 </if> | 142 // </if> |
143 | 143 |
144 /** @private */ | 144 /** @private */ |
145 onSafeBrowsingExtendedReportingCheckboxTap_: function() { | 145 onSafeBrowsingExtendedReportingCheckboxTap_: function() { |
146 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); | 146 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
147 var enabled = this.$.safeBrowsingExtendedReportingCheckbox.checked; | 147 var enabled = this.$.safeBrowsingExtendedReportingCheckbox.checked; |
148 browserProxy.setSafeBrowsingExtendedReportingEnabled(enabled); | 148 browserProxy.setSafeBrowsingExtendedReportingEnabled(enabled); |
149 }, | 149 }, |
150 | 150 |
151 /** @param {boolean} enabled Whether reporting is enabled or not. | 151 /** @param {boolean} enabled Whether reporting is enabled or not. |
152 * @private | 152 * @private |
153 */ | 153 */ |
154 setSafeBrowsingExtendedReporting_: function(enabled) { | 154 setSafeBrowsingExtendedReporting_: function(enabled) { |
155 this.safeBrowsingExtendedReportingEnabled_ = enabled; | 155 this.safeBrowsingExtendedReportingEnabled_ = enabled; |
156 }, | 156 }, |
157 | 157 |
158 /** | 158 /** |
159 * The sub-page title for the site or content settings. | 159 * The sub-page title for the site or content settings. |
160 * @return {string} | 160 * @return {string} |
161 * @private | 161 * @private |
162 */ | 162 */ |
163 siteSettingsPageTitle_: function() { | 163 siteSettingsPageTitle_: function() { |
164 return loadTimeData.getBoolean('enableSiteSettings') ? | 164 return loadTimeData.getBoolean('enableSiteSettings') ? |
165 loadTimeData.getString('siteSettings') : | 165 loadTimeData.getString('siteSettings') : |
166 loadTimeData.getString('contentSettings'); | 166 loadTimeData.getString('contentSettings'); |
167 }, | 167 }, |
168 | 168 |
169 <if expr="chromeos"> | 169 // <if expr="chromeos"> |
170 /** @private */ | 170 /** @private */ |
171 onAdobeFlashStorageClicked_: function() { | 171 onAdobeFlashStorageClicked_: function() { |
172 window.open('https://www.macromedia.com/support/' + | 172 window.open('https://www.macromedia.com/support/' + |
173 'documentation/en/flashplayer/help/settings_manager07.html'); | 173 'documentation/en/flashplayer/help/settings_manager07.html'); |
174 }, | 174 }, |
175 </if> | 175 // </if> |
176 }); | 176 }); |
OLD | NEW |