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 24 matching lines...) Expand all Loading... | |
| 35 constructor() { | 35 constructor() { |
| 36 super(true); | 36 super(true); |
| 37 this.registerRequiredCSS('main/renderingOptions.css'); | 37 this.registerRequiredCSS('main/renderingOptions.css'); |
| 38 | 38 |
| 39 /** @type {!Map.<string, !Element>} */ | 39 /** @type {!Map.<string, !Element>} */ |
| 40 this._settings = new Map(); | 40 this._settings = new Map(); |
| 41 | 41 |
| 42 var options = [ | 42 var options = [ |
| 43 { | 43 { |
| 44 label: Common.UIString('Paint Flashing'), | 44 label: Common.UIString('Paint Flashing'), |
| 45 subtitle: Common.UIString('Highlights areas of the page that need to be repainted'), | 45 subtitle: Common.UIString('Highlights areas of the page (green) that nee d to be repainted'), |
| 46 setterName: 'setShowPaintRects' | 46 setterName: 'setShowPaintRects' |
| 47 }, | 47 }, |
| 48 { | 48 { |
| 49 label: Common.UIString('Layer Borders'), | 49 label: Common.UIString('Layer Borders'), |
| 50 subtitle: Common.UIString('Shows layer borders (orange/olive) and tiles (cyan)'), | 50 subtitle: Common.UIString('Shows layer borders (orange/olive) and tiles (cyan)'), |
| 51 setterName: 'setShowDebugBorders' | 51 setterName: 'setShowDebugBorders' |
| 52 }, | 52 }, |
| 53 { | 53 { |
| 54 label: Common.UIString('FPS Meter'), | 54 label: Common.UIString('FPS Meter'), |
| 55 subtitle: Common.UIString('Plots frames per second, frame rate distribut ion, and GPU memory'), | 55 subtitle: Common.UIString('Plots frames per second, frame rate distribut ion, and GPU memory'), |
| 56 setterName: 'setShowFPSCounter' | 56 setterName: 'setShowFPSCounter' |
| 57 }, | 57 }, |
| 58 { | 58 { |
| 59 label: Common.UIString('Scrolling Performance Issues'), | 59 label: Common.UIString('Scrolling Performance Issues'), |
| 60 subtitle: Common.UIString('Shows areas of the page that slow down scroll ing'), | 60 subtitle: Common.UIString('Highlights elements (teal) that can slow down scrolling, including touch & wheel event handlers and other main-thread scrolli ng situations.'), |
| 61 setterName: 'setShowScrollBottleneckRects', | 61 setterName: 'setShowScrollBottleneckRects' |
| 62 tooltip: | |
| 63 'Touch and mousewheel event listeners can delay scrolling.\nSome are as need to repaint their content when scrolled.' | |
| 64 } | 62 } |
| 65 ]; | 63 ]; |
| 66 for (var i = 0; i < options.length; i++) | 64 for (var i = 0; i < options.length; i++) |
| 67 this._appendCheckbox(options[i].label, options[i].setterName, options[i].s ubtitle, options[i].tooltip); | 65 this._appendCheckbox(options[i].label, options[i].setterName, options[i].s ubtitle, options[i].tooltip); |
|
dgozman
2016/12/12 22:50:19
Remove tooltip from here.
phulce
2016/12/12 23:07:19
Done.
| |
| 68 | 66 |
| 69 this.contentElement.createChild('div').classList.add('panel-section-separato r'); | 67 this.contentElement.createChild('div').classList.add('panel-section-separato r'); |
| 70 | 68 |
| 71 var cssMediaSubtitle = Common.UIString('Forces media type for testing print and screen styles'); | 69 var cssMediaSubtitle = Common.UIString('Forces media type for testing print and screen styles'); |
| 72 var checkboxLabel = createCheckboxLabel(Common.UIString('Emulate CSS Media') , false, cssMediaSubtitle); | 70 var checkboxLabel = createCheckboxLabel(Common.UIString('Emulate CSS Media') , false, cssMediaSubtitle); |
| 73 this._mediaCheckbox = checkboxLabel.checkboxElement; | 71 this._mediaCheckbox = checkboxLabel.checkboxElement; |
| 74 this._mediaCheckbox.addEventListener('click', this._mediaToggled.bind(this), false); | 72 this._mediaCheckbox.addEventListener('click', this._mediaToggled.bind(this), false); |
| 75 this.contentElement.appendChild(checkboxLabel); | 73 this.contentElement.appendChild(checkboxLabel); |
| 76 | 74 |
| 77 var mediaRow = this.contentElement.createChild('div', 'media-row'); | 75 var mediaRow = this.contentElement.createChild('div', 'media-row'); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 92 Main.RenderingOptionsView._instanceObject = new Main.RenderingOptionsView( ); | 90 Main.RenderingOptionsView._instanceObject = new Main.RenderingOptionsView( ); |
| 93 return Main.RenderingOptionsView._instanceObject; | 91 return Main.RenderingOptionsView._instanceObject; |
| 94 } | 92 } |
| 95 | 93 |
| 96 /** | 94 /** |
| 97 * @param {string} label | 95 * @param {string} label |
| 98 * @param {string} setterName | 96 * @param {string} setterName |
| 99 * @param {string=} subtitle | 97 * @param {string=} subtitle |
| 100 * @param {string=} tooltip | 98 * @param {string=} tooltip |
| 101 */ | 99 */ |
| 102 _appendCheckbox(label, setterName, subtitle, tooltip) { | 100 _appendCheckbox(label, setterName, subtitle, tooltip) { |
|
dgozman
2016/12/12 22:50:19
And from here.
phulce
2016/12/12 23:07:19
Done.
| |
| 103 var checkboxLabel = createCheckboxLabel(label, false, subtitle); | 101 var checkboxLabel = createCheckboxLabel(label, false, subtitle); |
| 104 this._settings.set(setterName, checkboxLabel.checkboxElement); | 102 this._settings.set(setterName, checkboxLabel.checkboxElement); |
| 105 checkboxLabel.checkboxElement.addEventListener('click', this._settingToggled .bind(this, setterName)); | 103 checkboxLabel.checkboxElement.addEventListener('click', this._settingToggled .bind(this, setterName)); |
| 106 if (tooltip) | 104 if (tooltip) |
| 107 checkboxLabel.title = tooltip; | 105 checkboxLabel.title = tooltip; |
| 108 this.contentElement.appendChild(checkboxLabel); | 106 this.contentElement.appendChild(checkboxLabel); |
| 109 } | 107 } |
| 110 | 108 |
| 111 /** | 109 /** |
| 112 * @param {string} setterName | 110 * @param {string} setterName |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 cssModel.mediaQueryResultChanged(); | 145 cssModel.mediaQueryResultChanged(); |
| 148 } | 146 } |
| 149 | 147 |
| 150 /** | 148 /** |
| 151 * @override | 149 * @override |
| 152 * @param {!SDK.Target} target | 150 * @param {!SDK.Target} target |
| 153 */ | 151 */ |
| 154 targetRemoved(target) { | 152 targetRemoved(target) { |
| 155 } | 153 } |
| 156 }; | 154 }; |
| OLD | NEW |