| 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 26 matching lines...) Expand all Loading... |
| 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 <if expr="_google_chrome"> | |
| 48 observers: [ | |
| 49 'updateSpellingService_(prefs.spellcheck.use_spelling_service.value)', | |
| 50 ], | |
| 51 </if> | |
| 52 | |
| 53 ready: function() { | 47 ready: function() { |
| 54 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 48 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
| 55 | 49 |
| 56 <if expr="_google_chrome"> | |
| 57 this.updateSpellingService_(); | |
| 58 </if> | |
| 59 | |
| 60 <if expr="_google_chrome and not chromeos"> | 50 <if expr="_google_chrome and not chromeos"> |
| 61 var boundSetMetricsReporting = this.setMetricsReporting_.bind(this); | 51 var boundSetMetricsReporting = this.setMetricsReporting_.bind(this); |
| 62 this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting); | 52 this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting); |
| 63 | 53 |
| 64 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); | 54 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
| 65 browserProxy.getMetricsReporting().then(boundSetMetricsReporting); | 55 browserProxy.getMetricsReporting().then(boundSetMetricsReporting); |
| 66 </if> | 56 </if> |
| 67 | 57 |
| 68 var boundSetSber = this.setSafeBrowsingExtendedReporting_.bind(this); | 58 var boundSetSber = this.setSafeBrowsingExtendedReporting_.bind(this); |
| 69 this.addWebUIListener('safe-browsing-extended-reporting-change', | 59 this.addWebUIListener('safe-browsing-extended-reporting-change', |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 browserProxy.setSafeBrowsingExtendedReportingEnabled(enabled); | 148 browserProxy.setSafeBrowsingExtendedReportingEnabled(enabled); |
| 159 }, | 149 }, |
| 160 | 150 |
| 161 /** @param {boolean} enabled Whether reporting is enabled or not. | 151 /** @param {boolean} enabled Whether reporting is enabled or not. |
| 162 * @private | 152 * @private |
| 163 */ | 153 */ |
| 164 setSafeBrowsingExtendedReporting_: function(enabled) { | 154 setSafeBrowsingExtendedReporting_: function(enabled) { |
| 165 this.safeBrowsingExtendedReportingEnabled_ = enabled; | 155 this.safeBrowsingExtendedReportingEnabled_ = enabled; |
| 166 }, | 156 }, |
| 167 | 157 |
| 168 <if expr="_google_chrome"> | |
| 169 /** @private */ | |
| 170 updateSpellingService_: function() { | |
| 171 this.$.spellingServiceToggleButton.checked = | |
| 172 this.get('prefs.spellcheck.use_spelling_service.value'); | |
| 173 }, | |
| 174 | |
| 175 /** @private */ | |
| 176 onUseSpellingServiceTap_: function() { | |
| 177 this.set('prefs.spellcheck.use_spelling_service.value', | |
| 178 this.$.spellingServiceToggleButton.checked); | |
| 179 }, | |
| 180 </if> | |
| 181 | |
| 182 /** | 158 /** |
| 183 * The sub-page title for the site or content settings. | 159 * The sub-page title for the site or content settings. |
| 184 * @return {string} | 160 * @return {string} |
| 185 * @private | 161 * @private |
| 186 */ | 162 */ |
| 187 siteSettingsPageTitle_: function() { | 163 siteSettingsPageTitle_: function() { |
| 188 return loadTimeData.getBoolean('enableSiteSettings') ? | 164 return loadTimeData.getBoolean('enableSiteSettings') ? |
| 189 loadTimeData.getString('siteSettings') : | 165 loadTimeData.getString('siteSettings') : |
| 190 loadTimeData.getString('contentSettings'); | 166 loadTimeData.getString('contentSettings'); |
| 191 }, | 167 }, |
| 192 }); | 168 }); |
| OLD | NEW |