OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
8 * @implements {WebInspector.OverridesSupport.PageResizer} | 8 * @implements {WebInspector.OverridesSupport.PageResizer} |
9 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder | 9 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder |
10 */ | 10 */ |
11 WebInspector.ResponsiveDesignView = function(inspectedPagePlaceholder) | 11 WebInspector.ResponsiveDesignView = function(inspectedPagePlaceholder) |
12 { | 12 { |
13 WebInspector.VBox.call(this); | 13 WebInspector.VBox.call(this); |
14 this.registerRequiredCSS("responsiveDesignView.css"); | 14 this.registerRequiredCSS("responsiveDesignView.css"); |
15 | 15 |
16 this._container = new WebInspector.View(); | 16 this._container = new WebInspector.View(); |
17 this._container.element.classList.add("responsive-design"); | 17 this._container.element.classList.add("responsive-design"); |
18 | 18 |
19 this._canvas = this._container.element.createChild("canvas", "fill"); | 19 this._canvas = this._container.element.createChild("canvas", "fill"); |
20 this._resetButton = this._container.element.createChild("div", "responsive-d esign-reset-button"); | 20 this._resetButton = this._container.element.createChild("div", "responsive-d esign-reset-button"); |
21 this._resetButton.addEventListener("click", this._reset.bind(this), false); | 21 this._resetButton.addEventListener("click", this._reset.bind(this), false); |
22 this._resetButton.title = WebInspector.UIString("Fit available space"); | 22 this._resetButton.title = WebInspector.UIString("Fit available space"); |
23 | 23 |
24 this._slidersContainer = this._container.element.createChild("div", "vbox re sponsive-design-sliders-container"); | 24 this._slidersContainer = this._container.element.createChild("div", "vbox re sponsive-design-sliders-container"); |
25 var hbox = this._slidersContainer.createChild("div", "hbox flex-auto"); | 25 var hbox = this._slidersContainer.createChild("div", "hbox flex-auto"); |
26 this._heightSliderContainer = this._slidersContainer.createChild("div", "hbo x responsive-design-slider-height"); | 26 this._heightSliderContainer = this._slidersContainer.createChild("div", "hbo x responsive-design-slider-height"); |
27 this._resolutionHeightLabel = this._heightSliderContainer.createChild("div", "responsive-design-resolution-label responsive-design-resolution-height"); | |
27 this._pageContainer = hbox.createChild("div", "vbox flex-auto"); | 28 this._pageContainer = hbox.createChild("div", "vbox flex-auto"); |
28 this._widthSliderContainer = hbox.createChild("div", "vbox responsive-design -slider-width"); | 29 this._widthSliderContainer = hbox.createChild("div", "vbox responsive-design -slider-width"); |
30 this._resolutionWidthLabel = this._widthSliderContainer.createChild("div", " responsive-design-resolution-label responsive-design-resolution-width"); | |
29 | 31 |
30 this._widthSlider = this._widthSliderContainer.createChild("div", "responsiv e-design-slider-thumb"); | 32 this._widthSlider = this._widthSliderContainer.createChild("div", "responsiv e-design-slider-thumb"); |
33 this._widthSlider.createChild("div", "responsive-design-thumb-handle"); | |
31 this._createResizer(this._widthSlider, false); | 34 this._createResizer(this._widthSlider, false); |
32 this._widthZeroButton = this._widthSlider.createChild("div", "responsive-des ign-zero-button"); | |
33 this._widthZeroButton.addEventListener("click", this._zeroButtonClicked.bind (this, false)); | |
34 this._heightSlider = this._heightSliderContainer.createChild("div", "respons ive-design-slider-thumb"); | 35 this._heightSlider = this._heightSliderContainer.createChild("div", "respons ive-design-slider-thumb"); |
36 this._heightSlider.createChild("div", "responsive-design-thumb-handle"); | |
35 this._createResizer(this._heightSlider, true); | 37 this._createResizer(this._heightSlider, true); |
36 this._heightZeroButton = this._heightSlider.createChild("div", "responsive-d esign-zero-button"); | |
37 this._heightZeroButton.addEventListener("click", this._zeroButtonClicked.bin d(this, true)); | |
38 | 38 |
39 this._inspectedPagePlaceholder = inspectedPagePlaceholder; | 39 this._inspectedPagePlaceholder = inspectedPagePlaceholder; |
40 inspectedPagePlaceholder.show(this.element); | 40 inspectedPagePlaceholder.show(this.element); |
41 | 41 |
42 this._enabled = false; | 42 this._enabled = false; |
43 | 43 |
44 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo omChanged, this._onZoomChanged, this); | 44 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo omChanged, this._onZoomChanged, this); |
45 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._updateOverridesSupportOnDockSideChange, this); | 45 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._updateOverridesSupportOnDockSideChange, this); |
46 this._updateOverridesSupportOnDockSideChange(); | 46 this._updateOverridesSupportOnDockSideChange(); |
47 }; | 47 }; |
48 | 48 |
49 // Measured in DIP. | 49 // Measured in DIP. |
50 WebInspector.ResponsiveDesignView.SliderWidth = 19; | 50 WebInspector.ResponsiveDesignView.SliderWidth = 19; |
51 WebInspector.ResponsiveDesignView.RulerWidth = 23; | 51 WebInspector.ResponsiveDesignView.RulerWidth = 23; |
52 | 52 |
53 WebInspector.ResponsiveDesignView.prototype = { | 53 WebInspector.ResponsiveDesignView.prototype = { |
54 _updateOverridesSupportOnDockSideChange: function() | 54 _updateOverridesSupportOnDockSideChange: function() |
55 { | 55 { |
56 WebInspector.overridesSupport.setPageResizer(WebInspector.dockController .dockSide() !== WebInspector.DockController.State.Undocked ? this : null); | 56 WebInspector.overridesSupport.setPageResizer(WebInspector.dockController .dockSide() !== WebInspector.DockController.State.Undocked ? this : null); |
57 }, | 57 }, |
58 | 58 |
59 /** | 59 /** |
60 * WebInspector.OverridesSupport.PageResizer override. | 60 * WebInspector.OverridesSupport.PageResizer override. |
61 * @param {number} dipWidth | 61 * @param {number} dipWidth |
62 * @param {number} dipHeight | 62 * @param {number} dipHeight |
63 * @param {number} scale | 63 * @param {number} scale |
64 */ | 64 */ |
65 enable: function(dipWidth, dipHeight, scale) | 65 enable: function(dipWidth, dipHeight, scale) |
66 { | 66 { |
67 this._resolutionWidthLabel.classList.toggle("hidden", !this._enabled); | |
dgozman
2014/05/26 20:45:30
This is unnecessary, as the whole container is det
pfeldman
2014/05/27 07:37:13
Done.
| |
68 this._resolutionHeightLabel.classList.toggle("hidden", !this._enabled); | |
67 if (!this._enabled) { | 69 if (!this._enabled) { |
68 this._ignoreResize = true; | 70 this._ignoreResize = true; |
69 this._enabled = true; | 71 this._enabled = true; |
70 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); | 72 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); |
71 this._inspectedPagePlaceholder.show(this._pageContainer); | 73 this._inspectedPagePlaceholder.show(this._pageContainer); |
72 this._container.show(this.element); | 74 this._container.show(this.element); |
73 delete this._ignoreResize; | 75 delete this._ignoreResize; |
74 } | 76 } |
75 | 77 |
76 this._scale = scale; | 78 this._scale = scale; |
77 this._dipWidth = dipWidth; | 79 this._dipWidth = dipWidth; |
78 this._dipHeight = dipHeight; | 80 this._dipHeight = dipHeight; |
81 this._resolutionWidthLabel.textContent = dipWidth + "px"; | |
82 this._resolutionHeightLabel.textContent = dipHeight + "px"; | |
79 this._updateUI(); | 83 this._updateUI(); |
80 }, | 84 }, |
81 | 85 |
82 /** | 86 /** |
83 * WebInspector.OverridesSupport.PageResizer override. | 87 * WebInspector.OverridesSupport.PageResizer override. |
84 */ | 88 */ |
85 disable: function() | 89 disable: function() |
86 { | 90 { |
87 if (!this._enabled) | 91 if (!this._enabled) |
88 return; | 92 return; |
89 | 93 |
90 this._ignoreResize = true; | 94 this._ignoreResize = true; |
91 this._enabled = false; | 95 this._enabled = false; |
92 this._scale = 0; | 96 this._scale = 0; |
93 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); | 97 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); |
94 this._container.detach(); | 98 this._container.detach(); |
95 this._inspectedPagePlaceholder.show(this.element); | 99 this._inspectedPagePlaceholder.show(this.element); |
96 delete this._ignoreResize; | 100 delete this._ignoreResize; |
97 }, | 101 }, |
98 | 102 |
99 /** | 103 /** |
100 * WebInspector.OverridesSupport.PageResizer override. | 104 * WebInspector.OverridesSupport.PageResizer override. |
101 * @return {!Size} | 105 * @return {!Size} |
102 */ | 106 */ |
103 availableDipSize: function() | 107 availableDipSize: function() |
104 { | 108 { |
105 if (typeof this._availableSize === "undefined") { | 109 if (typeof this._availableSize === "undefined") { |
106 var zoomFactor = WebInspector.zoomManager.zoomFactor(); | 110 var zoomFactor = WebInspector.zoomManager.zoomFactor(); |
107 var rect = this.element.getBoundingClientRect(); | 111 var rect = this.element.getBoundingClientRect(); |
108 this._availableSize = new Size(rect.width * zoomFactor - WebInspecto r.ResponsiveDesignView.SliderWidth - WebInspector.ResponsiveDesignView.RulerWidt h, | 112 this._availableSize = new Size(rect.width * zoomFactor - WebInspecto r.ResponsiveDesignView.RulerWidth, |
109 rect.height * zoomFactor - WebInspect or.ResponsiveDesignView.SliderWidth - WebInspector.ResponsiveDesignView.RulerWid th); | 113 rect.height * zoomFactor - WebInspect or.ResponsiveDesignView.RulerWidth); |
110 } | 114 } |
111 return this._availableSize; | 115 return this._availableSize; |
112 }, | 116 }, |
113 | 117 |
114 /** | 118 /** |
115 * @param {!Element} element | 119 * @param {!Element} element |
116 * @param {boolean} vertical | 120 * @param {boolean} vertical |
117 * @return {!WebInspector.ResizerWidget} | 121 * @return {!WebInspector.ResizerWidget} |
118 */ | 122 */ |
119 _createResizer: function(element, vertical) | 123 _createResizer: function(element, vertical) |
(...skipping 16 matching lines...) Expand all Loading... | |
136 this._resizeStartSize = event.target.isVertical() ? (this._dipHeight || available.height) : (this._dipWidth || available.width); | 140 this._resizeStartSize = event.target.isVertical() ? (this._dipHeight || available.height) : (this._dipWidth || available.width); |
137 }, | 141 }, |
138 | 142 |
139 /** | 143 /** |
140 * @param {!WebInspector.Event} event | 144 * @param {!WebInspector.Event} event |
141 */ | 145 */ |
142 _onResizeUpdate: function(event) | 146 _onResizeUpdate: function(event) |
143 { | 147 { |
144 var cssOffset = event.data.currentPosition - event.data.startPosition; | 148 var cssOffset = event.data.currentPosition - event.data.startPosition; |
145 var dipOffset = cssOffset * WebInspector.zoomManager.zoomFactor(); | 149 var dipOffset = cssOffset * WebInspector.zoomManager.zoomFactor(); |
146 var newSize = this._resizeStartSize + dipOffset; | 150 var newSize = Math.max(this._resizeStartSize + dipOffset, 1); |
147 var requested = new Size(this._dipWidth, this._dipHeight); | 151 var requested = new Size(this._dipWidth, this._dipHeight); |
148 if (event.target.isVertical()) | 152 if (event.target.isVertical()) |
149 requested.height = Number.constrain(newSize, 1, this.availableDipSiz e().height); | 153 requested.height = newSize; |
150 else | 154 else |
151 requested.width = Number.constrain(newSize, 1, this.availableDipSize ().width); | 155 requested.width = newSize; |
152 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.ResizeRequested, requested); | 156 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.ResizeRequested, requested); |
153 }, | 157 }, |
154 | 158 |
155 /** | 159 /** |
156 * @param {!WebInspector.Event} event | 160 * @param {!WebInspector.Event} event |
157 */ | 161 */ |
158 _onResizeEnd: function(event) | 162 _onResizeEnd: function(event) |
159 { | 163 { |
160 delete this._resizeStartSize; | 164 delete this._resizeStartSize; |
161 }, | 165 }, |
162 | 166 |
163 /** | 167 /** |
164 * @param {boolean} isHeight | |
165 */ | |
166 _zeroButtonClicked: function(isHeight) | |
167 { | |
168 var size = new Size(this._dipWidth, this._dipHeight); | |
169 var available = this.availableDipSize(); | |
170 if (isHeight) | |
171 size.height = this._dipHeight ? 0 : available.height; | |
172 else | |
173 size.width = this._dipWidth ? 0 : available.width; | |
174 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.ResizeRequested, size); | |
175 }, | |
176 | |
177 /** | |
178 * Draws canvas of the specified css size in DevTools page space. | 168 * Draws canvas of the specified css size in DevTools page space. |
179 * Canvas contains grid and rulers. | 169 * Canvas contains grid and rulers. |
180 * @param {number} cssCanvasWidth | 170 * @param {number} cssCanvasWidth |
181 * @param {number} cssCanvasHeight | 171 * @param {number} cssCanvasHeight |
182 */ | 172 */ |
183 _drawCanvas: function(cssCanvasWidth, cssCanvasHeight) | 173 _drawCanvas: function(cssCanvasWidth, cssCanvasHeight) |
184 { | 174 { |
185 if (!this._enabled) | 175 if (!this._enabled) |
186 return; | 176 return; |
187 | 177 |
188 var canvas = this._canvas; | 178 var canvas = this._canvas; |
189 var context = canvas.getContext("2d"); | 179 var context = canvas.getContext("2d"); |
190 canvas.style.width = cssCanvasWidth + "px"; | 180 canvas.style.width = cssCanvasWidth + "px"; |
191 canvas.style.height = cssCanvasHeight + "px"; | 181 canvas.style.height = cssCanvasHeight + "px"; |
192 | 182 |
193 var zoomFactor = WebInspector.zoomManager.zoomFactor(); | 183 var zoomFactor = WebInspector.zoomManager.zoomFactor(); |
194 var dipCanvasWidth = cssCanvasWidth * zoomFactor; | 184 var dipCanvasWidth = cssCanvasWidth * zoomFactor; |
195 var dipCanvasHeight = cssCanvasHeight * zoomFactor; | 185 var dipCanvasHeight = cssCanvasHeight * zoomFactor; |
196 | 186 |
197 var deviceScaleFactor = window.devicePixelRatio; | 187 var deviceScaleFactor = window.devicePixelRatio; |
198 canvas.width = deviceScaleFactor * cssCanvasWidth; | 188 canvas.width = deviceScaleFactor * cssCanvasWidth; |
199 canvas.height = deviceScaleFactor * cssCanvasHeight; | 189 canvas.height = deviceScaleFactor * cssCanvasHeight; |
200 context.scale(canvas.width / dipCanvasWidth, canvas.height / dipCanvasHe ight); | 190 context.scale(canvas.width / dipCanvasWidth, canvas.height / dipCanvasHe ight); |
201 | 191 |
202 context.font = "10px " + WebInspector.monospaceFontFamily(); | 192 context.font = "11px " + WebInspector.fontFamily(); |
203 | 193 |
194 const rulerStep = 100; | |
195 const rulerSubStep = 5; | |
196 const gridStep = 50; | |
204 const gridSubStep = 10; | 197 const gridSubStep = 10; |
205 const gridStep = 50; | 198 const rulerBackgroundColor = "rgb(64, 64, 64)"; |
206 const rulerBackgroundColor = "rgb(54, 54, 54)"; | |
207 const backgroundColor = "rgb(102, 102, 102)"; | 199 const backgroundColor = "rgb(102, 102, 102)"; |
208 const lightLineColor = "rgb(132, 132, 132)"; | 200 const lightLineColor = "rgb(132, 132, 132)"; |
209 const darkLineColor = "rgb(114, 114, 114)"; | 201 const darkLineColor = "rgb(114, 114, 114)"; |
210 const textColor = "rgb(180, 180, 180)"; | 202 const textColor = "rgb(220, 220, 220)"; |
211 | 203 |
212 var scale = this._scale || 1; | 204 var scale = this._scale || 1; |
213 var rulerWidth = WebInspector.ResponsiveDesignView.RulerWidth; | 205 var rulerWidth = WebInspector.ResponsiveDesignView.RulerWidth; |
214 var dipGridWidth = dipCanvasWidth / scale - rulerWidth; | 206 var dipGridWidth = dipCanvasWidth / scale - rulerWidth; |
215 var dipGridHeight = dipCanvasHeight / scale - rulerWidth; | 207 var dipGridHeight = dipCanvasHeight / scale - rulerWidth; |
216 rulerWidth /= scale; | 208 rulerWidth /= scale; |
217 context.scale(scale, scale); | 209 context.scale(scale, scale); |
218 context.translate(rulerWidth, rulerWidth); | 210 context.translate(rulerWidth, rulerWidth); |
219 | 211 |
220 context.fillStyle = rulerBackgroundColor; | 212 context.fillStyle = rulerBackgroundColor; |
221 context.fillRect(0, -rulerWidth, dipGridWidth, rulerWidth); | 213 context.fillRect(0, -rulerWidth, dipGridWidth, rulerWidth); |
222 context.fillRect(-rulerWidth, 0, rulerWidth, dipGridHeight); | 214 context.fillRect(-rulerWidth, 0, rulerWidth, dipGridHeight); |
223 | 215 |
224 context.fillStyle = backgroundColor; | 216 context.fillStyle = backgroundColor; |
225 context.fillRect(0, 0, dipGridWidth, dipGridHeight); | 217 context.fillRect(0, 0, dipGridWidth, dipGridHeight); |
226 | 218 |
227 context.translate(0.5, 0.5); | 219 context.translate(0.5, 0.5); |
220 context.strokeStyle = textColor; | |
228 context.fillStyle = textColor; | 221 context.fillStyle = textColor; |
229 context.lineWidth = 1; | 222 context.lineWidth = 1; |
230 | 223 |
224 // Draw vertical ruler. | |
225 for (var x = 0; x < dipGridWidth; x += rulerSubStep) { | |
226 var color = darkLineColor; | |
227 var y = -rulerWidth / 4; | |
228 if (!(x % (rulerStep / 2))) | |
229 y = -rulerWidth / 2; | |
230 | |
231 if (!(x % rulerStep)) { | |
232 if (x) { | |
233 context.save(); | |
234 context.translate(x, 0); | |
235 context.fillText(x, 2, -rulerWidth / 2); | |
236 context.restore(); | |
237 } | |
238 y = -rulerWidth; | |
239 } | |
240 | |
241 context.beginPath(); | |
242 context.moveTo(x, y); | |
243 context.lineTo(x, 0); | |
244 context.stroke(); | |
245 } | |
246 | |
247 // Draw horizontal ruler. | |
248 for (var y = 0; y < dipGridHeight; y += rulerSubStep) { | |
249 var color = darkLineColor; | |
250 x = -rulerWidth / 4; | |
251 if (!(y % (rulerStep / 2))) | |
252 x = -rulerWidth / 2; | |
253 | |
254 if (!(y % rulerStep)) { | |
255 if (y) { | |
256 context.save(); | |
257 context.translate(0, y); | |
258 context.rotate(-Math.PI / 2); | |
259 context.fillText(y, 2, -rulerWidth / 2); | |
260 context.restore(); | |
261 } | |
262 x = -rulerWidth; | |
263 } | |
264 | |
265 context.beginPath(); | |
266 context.moveTo(x, y); | |
267 context.lineTo(0, y); | |
268 context.stroke(); | |
269 } | |
270 | |
271 // Draw grid. | |
272 drawGrid(darkLineColor, gridSubStep); | |
273 drawGrid(lightLineColor, gridStep); | |
274 | |
275 /** | |
276 * @param {string} color | |
277 * @param {number} step | |
278 */ | |
279 function drawGrid(color, step) | |
231 { | 280 { |
232 // Draw vertical lines. | 281 context.strokeStyle = color; |
233 for (var x = 0; x < dipGridWidth; x += gridSubStep) { | 282 for (var x = 0; x < dipGridWidth; x += step) { |
234 var color = darkLineColor; | |
235 var y = -rulerWidth / 6; | |
236 if (!(x % (2 * gridSubStep))) | |
237 y = -rulerWidth / 3; | |
238 if (!(x % gridStep)) { | |
239 if (x) { | |
240 context.save(); | |
241 context.translate(x, 0); | |
242 context.fillText(x, 2, -rulerWidth / 2); | |
243 context.restore(); | |
244 } | |
245 y = -rulerWidth; | |
246 color = lightLineColor; | |
247 } | |
248 context.strokeStyle = color; | |
249 | |
250 context.beginPath(); | 283 context.beginPath(); |
251 context.moveTo(x, y); | 284 context.moveTo(x, 0); |
252 context.lineTo(x, dipGridHeight); | 285 context.lineTo(x, dipGridHeight); |
253 context.stroke(); | 286 context.stroke(); |
254 } | 287 } |
255 } | 288 for (var y = 0; y < dipGridHeight; y += step) { |
256 | |
257 { | |
258 // Draw horizontal lines. | |
259 for (var y = 0; y < dipGridHeight; y += gridSubStep) { | |
260 var color = darkLineColor; | |
261 var x = -rulerWidth / 6; | |
262 if (!(y % (2 * gridSubStep))) | |
263 x = -rulerWidth / 3; | |
264 if (!(y % gridStep)) { | |
265 if (y) { | |
266 context.save(); | |
267 context.translate(0, y); | |
268 context.rotate(-Math.PI / 2); | |
269 context.fillText(y, 2, -rulerWidth / 2); | |
270 context.restore(); | |
271 } | |
272 x = -rulerWidth; | |
273 color = lightLineColor; | |
274 } | |
275 context.strokeStyle = color; | |
276 | |
277 context.beginPath(); | 289 context.beginPath(); |
278 context.moveTo(x, y); | 290 context.moveTo(0, y); |
279 context.lineTo(dipGridWidth, y); | 291 context.lineTo(dipGridWidth, y); |
280 context.stroke(); | 292 context.stroke(); |
281 } | 293 } |
282 context.restore(); | |
283 } | 294 } |
284 }, | 295 }, |
285 | 296 |
286 _updateUI: function() | 297 _updateUI: function() |
287 { | 298 { |
288 if (!this._enabled) | 299 if (!this._enabled) |
289 return; | 300 return; |
290 | 301 |
291 var zoomFactor = WebInspector.zoomManager.zoomFactor(); | 302 var zoomFactor = WebInspector.zoomManager.zoomFactor(); |
292 var rect = this._canvas.parentElement.getBoundingClientRect(); | 303 var rect = this._canvas.parentElement.getBoundingClientRect(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 _onZoomChanged: function() | 355 _onZoomChanged: function() |
345 { | 356 { |
346 this._updateUI(); | 357 this._updateUI(); |
347 }, | 358 }, |
348 | 359 |
349 /** | 360 /** |
350 * Resets emulated size to available space. | 361 * Resets emulated size to available space. |
351 */ | 362 */ |
352 _reset: function() | 363 _reset: function() |
353 { | 364 { |
354 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.ResizeRequested, this.availableDipSize()); | 365 var availableDipSize = this.availableDipSize(); |
366 var size = new Size(availableDipSize.width - WebInspector.ResponsiveDesi gnView.SliderWidth, | |
367 availableDipSize.height - WebInspector.ResponsiveDes ignView.SliderWidth); | |
368 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.ResizeRequested, size); | |
355 }, | 369 }, |
356 | 370 |
357 __proto__: WebInspector.VBox.prototype | 371 __proto__: WebInspector.VBox.prototype |
358 }; | 372 }; |
OLD | NEW |