Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.exportPath('options'); | 5 cr.exportPath('options'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @typedef {{actionLinkText: (string|undefined), | 8 * @typedef {{actionLinkText: (string|undefined), |
| 9 * childUser: (boolean|undefined), | 9 * childUser: (boolean|undefined), |
| 10 * hasError: (boolean|undefined), | 10 * hasError: (boolean|undefined), |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 var restartElements = | 457 var restartElements = |
| 458 $('metrics-reporting-reset-restart').querySelectorAll('*'); | 458 $('metrics-reporting-reset-restart').querySelectorAll('*'); |
| 459 for (var i = 0; i < restartTextFragments.length; i++) { | 459 for (var i = 0; i < restartTextFragments.length; i++) { |
| 460 restartElements[i].textContent = restartTextFragments[i]; | 460 restartElements[i].textContent = restartTextFragments[i]; |
| 461 } | 461 } |
| 462 restartElements[1].onclick = function(event) { | 462 restartElements[1].onclick = function(event) { |
| 463 chrome.send('restartBrowser'); | 463 chrome.send('restartBrowser'); |
| 464 }; | 464 }; |
| 465 // Attach the listener for updating the checkbox and restart button. | 465 // Attach the listener for updating the checkbox and restart button. |
| 466 var updateMetricsRestartButton = function() { | 466 var updateMetricsRestartButton = function() { |
| 467 $('metrics-reporting-reset-restart').hidden = | 467 if (cr.isMac) { |
| 468 loadTimeData.getBoolean('metricsReportingEnabledAtStart') == | 468 // A browser restart is never needed to toggle metrics reporting, |
| 469 $('metrics-reporting-enabled').checked; | 469 // and is only needed to toggle crash reporting when using Breakpad. |
| 470 // Crashpad, used on Mac, does not require a browser restart. | |
| 471 $('metrics-reporting-reset-restart').hidden = true; | |
| 472 } else { | |
|
Evan Stade
2015/03/23 21:46:19
I would make this function
if (cr.IsMac)
return
| |
| 473 $('metrics-reporting-reset-restart').hidden = | |
| 474 loadTimeData.getBoolean('metricsReportingEnabledAtStart') == | |
| 475 $('metrics-reporting-enabled').checked; | |
| 476 } | |
| 470 }; | 477 }; |
| 471 $('metrics-reporting-enabled').onclick = function(event) { | 478 $('metrics-reporting-enabled').onclick = function(event) { |
| 472 chrome.send('metricsReportingCheckboxChanged', | 479 chrome.send('metricsReportingCheckboxChanged', |
| 473 [Boolean(event.currentTarget.checked)]); | 480 [Boolean(event.currentTarget.checked)]); |
| 474 updateMetricsRestartButton(); | 481 updateMetricsRestartButton(); |
| 475 }; | 482 }; |
| 476 $('metrics-reporting-enabled').checked = | 483 $('metrics-reporting-enabled').checked = |
| 477 loadTimeData.getBoolean('metricsReportingEnabledAtStart'); | 484 loadTimeData.getBoolean('metricsReportingEnabledAtStart'); |
| 478 updateMetricsRestartButton(); | 485 updateMetricsRestartButton(); |
| 479 } | 486 } |
| (...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2266 } | 2273 } |
| 2267 button.textContent = loadTimeData.getString(strId); | 2274 button.textContent = loadTimeData.getString(strId); |
| 2268 }; | 2275 }; |
| 2269 } | 2276 } |
| 2270 | 2277 |
| 2271 // Export | 2278 // Export |
| 2272 return { | 2279 return { |
| 2273 BrowserOptions: BrowserOptions | 2280 BrowserOptions: BrowserOptions |
| 2274 }; | 2281 }; |
| 2275 }); | 2282 }); |
| OLD | NEW |