Chromium Code Reviews| 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 */ |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 Loading... | |
| 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 }; |
| OLD | NEW |