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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/RenderingOptions.js

Issue 1897383002: DevTools: Update styling for rendering drawer panel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.VBox} 33 * @extends {WebInspector.VBox}
34 * @implements {WebInspector.TargetManager.Observer} 34 * @implements {WebInspector.TargetManager.Observer}
35 */ 35 */
36 WebInspector.RenderingOptionsView = function() 36 WebInspector.RenderingOptionsView = function()
37 { 37 {
38 WebInspector.VBox.call(this, true); 38 WebInspector.VBox.call(this, true);
39 this.contentElement.classList.add("rendering-view");
39 this.registerRequiredCSS("main/renderingOptions.css"); 40 this.registerRequiredCSS("main/renderingOptions.css");
40 41
41 /** @type {!Map.<string, !Element>} */ 42 /** @type {!Map.<string, !Element>} */
42 this._settings = new Map(); 43 this._settings = new Map();
43 44
44 this._appendCheckbox(WebInspector.UIString("Enable paint flashing"), "setSho wPaintRects"); 45 var options = [
45 this._appendCheckbox(WebInspector.UIString("Show layer borders"), "setShowDe bugBorders"); 46 {
46 this._appendCheckbox(WebInspector.UIString("Show FPS meter"), "setShowFPSCou nter"); 47 label: WebInspector.UIString("Paint Flashing"),
47 var scrollingTitle = WebInspector.UIString("Shows areas of the page that slo w down scrolling:\nTouch and mousewheel event listeners can delay scrolling.\nSo me areas need to repaint their content when scrolled."); 48 subtitle: WebInspector.UIString("Highlights areas of the page that n eed to be repainted"),
48 this._appendCheckbox(WebInspector.UIString("Show scrolling perf issues"), "s etShowScrollBottleneckRects", scrollingTitle); 49 setterName: "setShowPaintRects"
50 },
51 {
52 label: WebInspector.UIString("Layer Borders"),
53 subtitle: WebInspector.UIString("Shows layer borders (orange) and su b-units (blue)"),
54 setterName: "setShowDebugBorders"
55 },
56 {
57 label: WebInspector.UIString("FPS Meter"),
58 subtitle: WebInspector.UIString("Frame rate per second, min. and max . frame values, GPU memory"),
59 setterName: "setShowFPSCounter"
60 },
61 {
62 label: WebInspector.UIString("Scrolling Performance Issues"),
63 subtitle: WebInspector.UIString("Shows areas of the page that slow d own scrolling"),
64 setterName: "setShowScrollBottleneckRects"
65 }
66 ];
67 for (var i = 0; i < options.length; i++)
68 this._appendCheckbox(options[i].label, options[i].setterName, options[i] .subtitle);
49 69
50 // CSS media. 70 this.contentElement.createChild("div").classList.add("panel-section-separato r");
51 var mediaRow = this.contentElement.createChild("div", "media-row"); 71
52 var checkboxLabel = createCheckboxLabel(WebInspector.UIString("Emulate media "), false); 72 var checkboxLabel = createCheckboxLabel(WebInspector.UIString("Emulate media "), false, WebInspector.UIString("Emulate CSS media"));
53 this._mediaCheckbox = checkboxLabel.checkboxElement; 73 this._mediaCheckbox = checkboxLabel.checkboxElement;
54 this._mediaCheckbox.addEventListener("click", this._mediaToggled.bind(this), false); 74 this._mediaCheckbox.addEventListener("click", this._mediaToggled.bind(this), false);
55 mediaRow.appendChild(checkboxLabel); 75 this.contentElement.appendChild(checkboxLabel);
76
77 var mediaRow = this.contentElement.createChild("div", "media-row");
56 this._mediaSelect = mediaRow.createChild("select", "chrome-select"); 78 this._mediaSelect = mediaRow.createChild("select", "chrome-select");
57 this._mediaSelect.appendChild(new Option(WebInspector.UIString("print"), "pr int")); 79 this._mediaSelect.appendChild(new Option(WebInspector.UIString("print"), "pr int"));
58 this._mediaSelect.appendChild(new Option(WebInspector.UIString("screen"), "s creen")); 80 this._mediaSelect.appendChild(new Option(WebInspector.UIString("screen"), "s creen"));
59 this._mediaSelect.addEventListener("change", this._mediaToggled.bind(this), false); 81 this._mediaSelect.addEventListener("change", this._mediaToggled.bind(this), false);
60 this._mediaSelect.disabled = true; 82 this._mediaSelect.disabled = true;
61 83
62 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e); 84 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e);
63 } 85 }
64 86
65 WebInspector.RenderingOptionsView.prototype = { 87 WebInspector.RenderingOptionsView.prototype = {
66 /** 88 /**
67 * @param {string} label 89 * @param {string} label
68 * @param {string} setterName 90 * @param {string} setterName
69 * @param {string=} title 91 * @param {string=} subtitle
70 */ 92 */
71 _appendCheckbox: function(label, setterName, title) 93 _appendCheckbox: function(label, setterName, subtitle)
72 { 94 {
73 var checkboxLabel = createCheckboxLabel(label, false); 95 var checkboxLabel = createCheckboxLabel(label, false, subtitle);
74 this._settings.set(setterName, checkboxLabel.checkboxElement); 96 this._settings.set(setterName, checkboxLabel.checkboxElement);
75 checkboxLabel.checkboxElement.addEventListener("click", this._settingTog gled.bind(this, setterName)); 97 checkboxLabel.checkboxElement.addEventListener("click", this._settingTog gled.bind(this, setterName));
76 if (title)
77 checkboxLabel.title = title;
78 this.contentElement.appendChild(checkboxLabel); 98 this.contentElement.appendChild(checkboxLabel);
79 }, 99 },
80 100
81 /** 101 /**
82 * @param {string} setterName 102 * @param {string} setterName
83 */ 103 */
84 _settingToggled: function(setterName) 104 _settingToggled: function(setterName)
85 { 105 {
86 var enabled = this._settings.get(setterName).checked; 106 var enabled = this._settings.get(setterName).checked;
87 var targets = WebInspector.targetManager.targets(WebInspector.Target.Typ e.Page); 107 var targets = WebInspector.targetManager.targets(WebInspector.Target.Typ e.Page);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 * @param {!WebInspector.Context} context 177 * @param {!WebInspector.Context} context
158 * @param {string} actionId 178 * @param {string} actionId
159 * @return {boolean} 179 * @return {boolean}
160 */ 180 */
161 handleAction: function(context, actionId) 181 handleAction: function(context, actionId)
162 { 182 {
163 WebInspector.inspectorView.showViewInDrawer("rendering"); 183 WebInspector.inspectorView.showViewInDrawer("rendering");
164 return true; 184 return true;
165 } 185 }
166 } 186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698