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

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 1032573002: Don't show "requires Chrome restart" when toggling stats reporting on Mac OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698