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

Unified Diff: chrome/browser/resources/profiler.js

Issue 8601003: Small tweak to about:profiler -- make the labels for checkboxes clickable (so you have a bigger t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/profiler.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/profiler.js
===================================================================
--- chrome/browser/resources/profiler.js (revision 110549)
+++ chrome/browser/resources/profiler.js (working copy)
@@ -730,6 +730,18 @@
}
/**
+ * Adds a checkbox to |parent|. The checkbox will have a label on its right
+ * with text |label|. Returns the checkbox input node.
+ */
+ function addLabeledCheckbox(parent, label) {
+ var labelNode = addNode(parent, 'label');
+ var checkbox = addNode(labelNode, 'input');
+ checkbox.type = 'checkbox';
+ addText(labelNode, label);
+ return checkbox;
+ }
+
+ /**
* Return the last component in a path which is separated by either forward
* slashes or backslashes.
*/
@@ -1484,13 +1496,14 @@
fillSelectionCheckboxes_: function(parent) {
this.selectionCheckboxes_ = {};
+ var onChangeFunc = this.onSelectCheckboxChanged_.bind(this);
+
for (var i = 0; i < ALL_TABLE_COLUMNS.length; ++i) {
var key = ALL_TABLE_COLUMNS[i];
- var checkbox = addNode(parent, 'input');
- checkbox.type = 'checkbox';
- checkbox.onchange = this.onSelectCheckboxChanged_.bind(this);
+ var checkbox = addLabeledCheckbox(parent, getNameForKey(key));
checkbox.checked = true;
- addNode(parent, 'span', getNameForKey(key) + ' ');
+ checkbox.onchange = onChangeFunc;
+ addText(parent, ' ');
this.selectionCheckboxes_[key] = checkbox;
}
@@ -1514,13 +1527,13 @@
fillMergeCheckboxes_: function(parent) {
this.mergeCheckboxes_ = {};
+ var onChangeFunc = this.onMergeCheckboxChanged_.bind(this);
+
for (var i = 0; i < MERGEABLE_KEYS.length; ++i) {
var key = MERGEABLE_KEYS[i];
- var checkbox = addNode(parent, 'input');
- checkbox.type = 'checkbox';
- checkbox.onchange = this.onMergeCheckboxChanged_.bind(this);
- checkbox.checked = false;
- addNode(parent, 'span', getNameForKey(key) + ' ');
+ var checkbox = addLabeledCheckbox(parent, getNameForKey(key));
+ checkbox.onchange = onChangeFunc;
+ addText(parent, ' ');
this.mergeCheckboxes_[key] = checkbox;
}
« no previous file with comments | « chrome/browser/resources/profiler.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698