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

Side by Side Diff: Source/devtools/front_end/settings/SettingsScreen.js

Issue 805853002: DevTools: Make labeled checkbox a web component (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | Annotate | Revision Log
OLDNEW
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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 var warning = subsection.createChild("span", "settings-experiments-warni ng-subsection-warning"); 581 var warning = subsection.createChild("span", "settings-experiments-warni ng-subsection-warning");
582 warning.textContent = WebInspector.UIString("WARNING:"); 582 warning.textContent = WebInspector.UIString("WARNING:");
583 subsection.createTextChild(" "); 583 subsection.createTextChild(" ");
584 var message = subsection.createChild("span", "settings-experiments-warni ng-subsection-message"); 584 var message = subsection.createChild("span", "settings-experiments-warni ng-subsection-message");
585 message.textContent = WebInspector.UIString("These experiments could be dangerous and may require restart."); 585 message.textContent = WebInspector.UIString("These experiments could be dangerous and may require restart.");
586 return subsection; 586 return subsection;
587 }, 587 },
588 588
589 _createExperimentCheckbox: function(experiment) 589 _createExperimentCheckbox: function(experiment)
590 { 590 {
591 var input = createElement("input"); 591 var label = createCheckboxLabel(WebInspector.UIString(experiment.title), experiment.isEnabled());
592 input.type = "checkbox"; 592 var input = label.checkboxElement;
593 input.name = experiment.name; 593 input.name = experiment.name;
594 input.checked = experiment.isEnabled();
595 function listener() 594 function listener()
596 { 595 {
597 experiment.setEnabled(input.checked); 596 experiment.setEnabled(input.checked);
598 } 597 }
599 input.addEventListener("click", listener, false); 598 input.addEventListener("click", listener, false);
600 599
601 var p = createElement("p"); 600 var p = createElement("p");
602 p.className = experiment.hidden && !experiment.isEnabled() ? "settings-e xperiment-hidden" : ""; 601 p.className = experiment.hidden && !experiment.isEnabled() ? "settings-e xperiment-hidden" : "";
603 var label = p.createChild("label");
604 label.appendChild(input);
605 label.createTextChild(WebInspector.UIString(experiment.title));
606 p.appendChild(label); 602 p.appendChild(label);
607 return p; 603 return p;
608 }, 604 },
609 605
610 __proto__: WebInspector.SettingsTab.prototype 606 __proto__: WebInspector.SettingsTab.prototype
611 } 607 }
612 608
613 /** 609 /**
614 * @constructor 610 * @constructor
615 */ 611 */
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 var columnId = columns[i]; 1142 var columnId = columns[i];
1147 var editElement = this._addInputElements.get(columnId); 1143 var editElement = this._addInputElements.get(columnId);
1148 this._setEditElementValue(editElement, ""); 1144 this._setEditElementValue(editElement, "");
1149 } 1145 }
1150 }, 1146 },
1151 1147
1152 __proto__: WebInspector.SettingsList.prototype 1148 __proto__: WebInspector.SettingsList.prototype
1153 } 1149 }
1154 1150
1155 WebInspector._settingsController = new WebInspector.SettingsController(); 1151 WebInspector._settingsController = new WebInspector.SettingsController();
OLDNEW
« no previous file with comments | « Source/devtools/front_end/main/OverridesView.js ('k') | Source/devtools/front_end/sources/AdvancedSearchView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698