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

Side by Side Diff: chrome/browser/resources/settings/privacy_page/privacy_page.js

Issue 2494813002: MD Settings: slight tweaks to when the metrics reporting restart button shows up (Closed)
Patch Set: fixes Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/metrics_reporting_tests.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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({
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/metrics_reporting_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698