| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); | 120 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
| 121 var enabled = this.$.metricsReportingCheckbox.checked; | 121 var enabled = this.$.metricsReportingCheckbox.checked; |
| 122 browserProxy.setMetricsReportingEnabled(enabled); | 122 browserProxy.setMetricsReportingEnabled(enabled); |
| 123 }, | 123 }, |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * @param {!MetricsReporting} metricsReporting | 126 * @param {!MetricsReporting} metricsReporting |
| 127 * @private | 127 * @private |
| 128 */ | 128 */ |
| 129 setMetricsReporting_: function(metricsReporting) { | 129 setMetricsReporting_: function(metricsReporting) { |
| 130 if (this.metricsReporting_) { | 130 // TODO(dbeam): remember whether metrics reporting was enabled when Chrome |
| 131 // TODO(dbeam): hide if changed back to the value Chrome started with. | 131 // started. |
| 132 var changed = this.metricsReporting_.enabled != metricsReporting.enabled; | 132 if (metricsReporting.managed) { |
| 133 this.showRestart_ = changed && !this.metricsReporting_.managed; | 133 this.showRestart_ = false; |
| 134 } else if (this.metricsReporting_ && |
| 135 metricsReporting.enabled != this.metricsReporting_.enabled) { |
| 136 this.showRestart_ = true; |
| 134 } | 137 } |
| 135 this.metricsReporting_ = metricsReporting; | 138 this.metricsReporting_ = metricsReporting; |
| 136 }, | 139 }, |
| 137 | 140 |
| 138 /** @private */ | 141 /** @private */ |
| 139 onRestartTap_: function() { | 142 onRestartTap_: function() { |
| 140 settings.LifetimeBrowserProxyImpl.getInstance().restart(); | 143 settings.LifetimeBrowserProxyImpl.getInstance().restart(); |
| 141 }, | 144 }, |
| 142 </if> | 145 </if> |
| 143 | 146 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 159 * The sub-page title for the site or content settings. | 162 * The sub-page title for the site or content settings. |
| 160 * @return {string} | 163 * @return {string} |
| 161 * @private | 164 * @private |
| 162 */ | 165 */ |
| 163 siteSettingsPageTitle_: function() { | 166 siteSettingsPageTitle_: function() { |
| 164 return loadTimeData.getBoolean('enableSiteSettings') ? | 167 return loadTimeData.getBoolean('enableSiteSettings') ? |
| 165 loadTimeData.getString('siteSettings') : | 168 loadTimeData.getString('siteSettings') : |
| 166 loadTimeData.getString('contentSettings'); | 169 loadTimeData.getString('contentSettings'); |
| 167 }, | 170 }, |
| 168 }); | 171 }); |
| OLD | NEW |