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 23 matching lines...) Expand all Loading... |
34 */ | 34 */ |
35 WebInspector.RenderingOptions = function() | 35 WebInspector.RenderingOptions = function() |
36 { | 36 { |
37 /** | 37 /** |
38 * @type {!Map.<!WebInspector.Setting, string>} | 38 * @type {!Map.<!WebInspector.Setting, string>} |
39 */ | 39 */ |
40 this._setterNames = new Map(); | 40 this._setterNames = new Map(); |
41 this._mapSettingToSetter(WebInspector.moduleSetting("showPaintRects"), "setS
howPaintRects"); | 41 this._mapSettingToSetter(WebInspector.moduleSetting("showPaintRects"), "setS
howPaintRects"); |
42 this._mapSettingToSetter(WebInspector.moduleSetting("showDebugBorders"), "se
tShowDebugBorders"); | 42 this._mapSettingToSetter(WebInspector.moduleSetting("showDebugBorders"), "se
tShowDebugBorders"); |
43 this._mapSettingToSetter(WebInspector.moduleSetting("showFPSCounter"), "setS
howFPSCounter"); | 43 this._mapSettingToSetter(WebInspector.moduleSetting("showFPSCounter"), "setS
howFPSCounter"); |
44 this._mapSettingToSetter(WebInspector.moduleSetting("continuousPainting"), "
setContinuousPaintingEnabled"); | |
45 this._mapSettingToSetter(WebInspector.moduleSetting("showScrollBottleneckRec
ts"), "setShowScrollBottleneckRects"); | 44 this._mapSettingToSetter(WebInspector.moduleSetting("showScrollBottleneckRec
ts"), "setShowScrollBottleneckRects"); |
46 | 45 |
47 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag
e); | 46 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag
e); |
48 } | 47 } |
49 | 48 |
50 WebInspector.RenderingOptions.prototype = { | 49 WebInspector.RenderingOptions.prototype = { |
51 /** | 50 /** |
52 * @override | 51 * @override |
53 * @param {!WebInspector.Target} target | 52 * @param {!WebInspector.Target} target |
54 */ | 53 */ |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 WebInspector.RenderingOptions.View = function() | 96 WebInspector.RenderingOptions.View = function() |
98 { | 97 { |
99 WebInspector.VBox.call(this); | 98 WebInspector.VBox.call(this); |
100 this.registerRequiredCSS("ui/helpScreen.css"); | 99 this.registerRequiredCSS("ui/helpScreen.css"); |
101 this.element.classList.add("help-indent-labels"); | 100 this.element.classList.add("help-indent-labels"); |
102 | 101 |
103 var div = this.element.createChild("div", "settings-tab help-content help-co
ntainer help-no-columns"); | 102 var div = this.element.createChild("div", "settings-tab help-content help-co
ntainer help-no-columns"); |
104 div.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.U
IString("Enable paint flashing"), WebInspector.moduleSetting("showPaintRects")))
; | 103 div.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.U
IString("Enable paint flashing"), WebInspector.moduleSetting("showPaintRects")))
; |
105 div.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.U
IString("Show layer borders"), WebInspector.moduleSetting("showDebugBorders"))); | 104 div.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.U
IString("Show layer borders"), WebInspector.moduleSetting("showDebugBorders"))); |
106 div.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.U
IString("Show FPS meter"), WebInspector.moduleSetting("showFPSCounter"))); | 105 div.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.U
IString("Show FPS meter"), WebInspector.moduleSetting("showFPSCounter"))); |
107 div.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.U
IString("Enable continuous repainting"), WebInspector.moduleSetting("continuousP
ainting"))); | |
108 var child = WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStr
ing("Show scrolling perf issues"), WebInspector.moduleSetting("showScrollBottlen
eckRects")); | 106 var child = WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStr
ing("Show scrolling perf issues"), WebInspector.moduleSetting("showScrollBottlen
eckRects")); |
109 child.title = WebInspector.UIString("Shows areas of the page that slow down
scrolling:\nTouch and mousewheel event listeners can delay scrolling.\nSome area
s need to repaint their content when scrolled."); | 107 child.title = WebInspector.UIString("Shows areas of the page that slow down
scrolling:\nTouch and mousewheel event listeners can delay scrolling.\nSome area
s need to repaint their content when scrolled."); |
110 div.appendChild(child); | 108 div.appendChild(child); |
111 } | 109 } |
112 | 110 |
113 WebInspector.RenderingOptions.View.prototype = { | 111 WebInspector.RenderingOptions.View.prototype = { |
114 __proto__: WebInspector.VBox.prototype | 112 __proto__: WebInspector.VBox.prototype |
115 } | 113 } |
116 | 114 |
117 /** | 115 /** |
118 * @constructor | 116 * @constructor |
119 * @implements {WebInspector.ToolbarItem.Provider} | 117 * @implements {WebInspector.ToolbarItem.Provider} |
120 */ | 118 */ |
121 WebInspector.RenderingOptions.ButtonProvider = function() | 119 WebInspector.RenderingOptions.ButtonProvider = function() |
122 { | 120 { |
123 this._button = new WebInspector.ToolbarMenuButton(WebInspector.UIString("Ren
dering performance options"), "timer-toolbar-item", this._appendItems.bind(this)
); | 121 this._button = new WebInspector.ToolbarMenuButton(WebInspector.UIString("Ren
dering performance options"), "timer-toolbar-item", this._appendItems.bind(this)
); |
124 this._renderingOptions = [{ label: WebInspector.UIString("Enable paint flash
ing"), setting: WebInspector.moduleSetting("showPaintRects") }, | 122 this._renderingOptions = [{ label: WebInspector.UIString("Enable paint flash
ing"), setting: WebInspector.moduleSetting("showPaintRects") }, |
125 { label: WebInspector.UIString("Show layer borders"), setting: WebInspec
tor.moduleSetting("showDebugBorders") }, | 123 { label: WebInspector.UIString("Show layer borders"), setting: WebInspec
tor.moduleSetting("showDebugBorders") }, |
126 { label: WebInspector.UIString("Show scrolling perf issues"), setting: W
ebInspector.moduleSetting("showScrollBottleneckRects") }, | 124 { label: WebInspector.UIString("Show scrolling perf issues"), setting: W
ebInspector.moduleSetting("showScrollBottleneckRects") }, |
127 { label: WebInspector.UIString("Show FPS meter"), setting: WebInspector.
moduleSetting("showFPSCounter") }, | 125 { label: WebInspector.UIString("Show FPS meter"), setting: WebInspector.
moduleSetting("showFPSCounter") }]; |
128 { label: WebInspector.UIString("Enable continuous repainting"), setting:
WebInspector.moduleSetting("continuousPainting") }]; | |
129 } | 126 } |
130 | 127 |
131 WebInspector.RenderingOptions.ButtonProvider.prototype = { | 128 WebInspector.RenderingOptions.ButtonProvider.prototype = { |
132 /** | 129 /** |
133 * @override | 130 * @override |
134 * @return {?WebInspector.ToolbarItem} | 131 * @return {?WebInspector.ToolbarItem} |
135 */ | 132 */ |
136 item: function() | 133 item: function() |
137 { | 134 { |
138 return this._button; | 135 return this._button; |
139 }, | 136 }, |
140 | 137 |
141 /** | 138 /** |
142 * @param {!WebInspector.ContextMenu} contextMenu | 139 * @param {!WebInspector.ContextMenu} contextMenu |
143 */ | 140 */ |
144 _appendItems: function(contextMenu) | 141 _appendItems: function(contextMenu) |
145 { | 142 { |
146 for (var option of this._renderingOptions) | 143 for (var option of this._renderingOptions) |
147 contextMenu.appendCheckboxItem(option.label, this._toggleSetting.bin
d(this, option.setting), option.setting.get()); | 144 contextMenu.appendCheckboxItem(option.label, this._toggleSetting.bin
d(this, option.setting), option.setting.get()); |
148 }, | 145 }, |
149 | 146 |
150 /** | 147 /** |
151 * @param {!WebInspector.Setting} setting | 148 * @param {!WebInspector.Setting} setting |
152 */ | 149 */ |
153 _toggleSetting: function(setting) | 150 _toggleSetting: function(setting) |
154 { | 151 { |
155 setting.set(!setting.get()); | 152 setting.set(!setting.get()); |
156 } | 153 } |
157 } | 154 } |
OLD | NEW |