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

Side by Side Diff: Source/devtools/front_end/ResponsiveDesignView.js

Issue 321513004: [DevTools] Limit responsive design resize request to width/height only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/sdk/OverridesSupport.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 */
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 /** 166 /**
167 * @param {!WebInspector.Event} event 167 * @param {!WebInspector.Event} event
168 */ 168 */
169 _onResizeUpdate: function(event) 169 _onResizeUpdate: function(event)
170 { 170 {
171 if (event.data.shiftKey !== !!this._slowPositionStart) 171 if (event.data.shiftKey !== !!this._slowPositionStart)
172 this._slowPositionStart = event.data.shiftKey ? event.data.currentPo sition : null; 172 this._slowPositionStart = event.data.shiftKey ? event.data.currentPo sition : null;
173 var cssOffset = this._slowPositionStart ? (event.data.currentPosition - this._slowPositionStart) / 10 + this._slowPositionStart - event.data.startPositi on : event.data.currentPosition - event.data.startPosition; 173 var cssOffset = this._slowPositionStart ? (event.data.currentPosition - this._slowPositionStart) / 10 + this._slowPositionStart - event.data.startPositi on : event.data.currentPosition - event.data.startPosition;
174 var dipOffset = Math.round(cssOffset * WebInspector.zoomManager.zoomFact or()); 174 var dipOffset = Math.round(cssOffset * WebInspector.zoomManager.zoomFact or());
175 var newSize = Math.max(this._resizeStartSize + dipOffset, 1); 175 var newSize = Math.max(this._resizeStartSize + dipOffset, 1);
176 var requested = new Size(this._dipWidth, this._dipHeight); 176 var requested = new Size(-1, -1);
lushnikov 2014/06/06 13:40:47 This looks like a hack. Given that only one axis c
dgozman 2014/06/06 13:47:32 We have plans for two-dimensional resize aswell, w
177 if (event.target.isVertical()) 177 if (event.target.isVertical())
178 requested.height = newSize; 178 requested.height = newSize;
179 else 179 else
180 requested.width = newSize; 180 requested.width = newSize;
181 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.ResizeRequested, requested); 181 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer. Events.ResizeRequested, requested);
182 }, 182 },
183 183
184 /** 184 /**
185 * @param {!WebInspector.Event} event 185 * @param {!WebInspector.Event} event
186 */ 186 */
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 if (this._warningMessage.textContent === message) 504 if (this._warningMessage.textContent === message)
505 return; 505 return;
506 this._warningMessage.classList.toggle("hidden", !message); 506 this._warningMessage.classList.toggle("hidden", !message);
507 this._warningMessage.textContent = message; 507 this._warningMessage.textContent = message;
508 this._invalidateCache(); 508 this._invalidateCache();
509 this.onResize(); 509 this.onResize();
510 }, 510 },
511 511
512 __proto__: WebInspector.VBox.prototype 512 __proto__: WebInspector.VBox.prototype
513 }; 513 };
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/sdk/OverridesSupport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698