Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 694 message.textContent = WebInspector.UIString("These experiments could be dangerous and may require restart."); | 694 message.textContent = WebInspector.UIString("These experiments could be dangerous and may require restart."); |
| 695 return subsection; | 695 return subsection; |
| 696 }, | 696 }, |
| 697 | 697 |
| 698 _createExperimentCheckbox: function(experiment) | 698 _createExperimentCheckbox: function(experiment) |
| 699 { | 699 { |
| 700 var input = document.createElement("input"); | 700 var input = document.createElement("input"); |
| 701 input.type = "checkbox"; | 701 input.type = "checkbox"; |
| 702 input.name = experiment.name; | 702 input.name = experiment.name; |
| 703 input.checked = experiment.isEnabled(); | 703 input.checked = experiment.isEnabled(); |
| 704 | |
| 705 if (experiment.name === "powerProfile") { | |
|
pfeldman
2014/01/09 11:38:52
This seems wrong - generic method should not be co
| |
| 706 function powerProfileStatusCallback(event) { | |
| 707 if (event.data) | |
| 708 return; | |
| 709 input.disabled = true; | |
| 710 experiment.setEnabled(false); | |
| 711 } | |
| 712 WebInspector.powerProfiler.addEventListener(WebInspector.PowerProfil er.EventTypes.PowerProfileSupportStatus, powerProfileStatusCallback); | |
| 713 WebInspector.powerProfiler.checkStatus(); | |
|
pfeldman
2014/01/09 11:38:52
You should allow enabling this experiment uncondit
| |
| 714 } | |
| 715 | |
| 704 function listener() | 716 function listener() |
| 705 { | 717 { |
| 706 experiment.setEnabled(input.checked); | 718 experiment.setEnabled(input.checked); |
| 707 } | 719 } |
| 708 input.addEventListener("click", listener, false); | 720 input.addEventListener("click", listener, false); |
| 709 | 721 |
| 710 var p = document.createElement("p"); | 722 var p = document.createElement("p"); |
| 711 var label = document.createElement("label"); | 723 var label = document.createElement("label"); |
| 712 label.appendChild(input); | 724 label.appendChild(input); |
| 713 label.appendChild(document.createTextNode(WebInspector.UIString(experime nt.title))); | 725 label.appendChild(document.createTextNode(WebInspector.UIString(experime nt.title))); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1148 var columns = this.columns(); | 1160 var columns = this.columns(); |
| 1149 for (var i = 0; i < columns.length; ++i) { | 1161 for (var i = 0; i < columns.length; ++i) { |
| 1150 var columnId = columns[i]; | 1162 var columnId = columns[i]; |
| 1151 var inputElement = this._addInputElements[columnId]; | 1163 var inputElement = this._addInputElements[columnId]; |
| 1152 inputElement.value = ""; | 1164 inputElement.value = ""; |
| 1153 } | 1165 } |
| 1154 }, | 1166 }, |
| 1155 | 1167 |
| 1156 __proto__: WebInspector.SettingsList.prototype | 1168 __proto__: WebInspector.SettingsList.prototype |
| 1157 } | 1169 } |
| OLD | NEW |