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.Widget} | 7 * @extends {WebInspector.Widget} |
8 */ | 8 */ |
9 WebInspector.InspectedPagePlaceholder = function() | 9 WebInspector.InspectedPagePlaceholder = function() |
10 { | 10 { |
11 WebInspector.Widget.call(this); | 11 WebInspector.Widget.call(this); |
12 this.element.classList.add("inspected-page-placeholder"); | 12 this.element.classList.add("inspected-page-placeholder"); |
13 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo
omChanged, this._scheduleUpdate, this); | 13 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo
omChanged, this._scheduleUpdate, this); |
14 this._margins = { top: 0, right: 0, bottom: 0, left: 0 }; | 14 this._margins = { top: 0, right: 0, bottom: 0, left: 0 }; |
15 this.restoreMinimumSizeAndMargins(); | 15 this.restoreMinimumSizeAndMargins(); |
16 }; | 16 }; |
17 | 17 |
| 18 /** @enum {symbol} */ |
18 WebInspector.InspectedPagePlaceholder.Events = { | 19 WebInspector.InspectedPagePlaceholder.Events = { |
19 Update: "Update" | 20 Update: Symbol("Update") |
20 }; | 21 }; |
21 | 22 |
22 WebInspector.InspectedPagePlaceholder.MarginValue = 3; | 23 WebInspector.InspectedPagePlaceholder.MarginValue = 3; |
23 | 24 |
24 WebInspector.InspectedPagePlaceholder.prototype = { | 25 WebInspector.InspectedPagePlaceholder.prototype = { |
25 _findMargins: function() | 26 _findMargins: function() |
26 { | 27 { |
27 var margins = { top: 0, right: 0, bottom: 0, left: 0 }; | 28 var margins = { top: 0, right: 0, bottom: 0, left: 0 }; |
28 | 29 |
29 if (this._useMargins) { | 30 if (this._useMargins) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 update: function() | 94 update: function() |
94 { | 95 { |
95 delete this._updateId; | 96 delete this._updateId; |
96 var rect = this._dipPageRect(); | 97 var rect = this._dipPageRect(); |
97 var bounds = { x: Math.round(rect.x), y: Math.round(rect.y), height: Mat
h.max(1, Math.round(rect.height)), width: Math.max(1, Math.round(rect.width)) }; | 98 var bounds = { x: Math.round(rect.x), y: Math.round(rect.y), height: Mat
h.max(1, Math.round(rect.height)), width: Math.max(1, Math.round(rect.width)) }; |
98 this.dispatchEventToListeners(WebInspector.InspectedPagePlaceholder.Even
ts.Update, bounds); | 99 this.dispatchEventToListeners(WebInspector.InspectedPagePlaceholder.Even
ts.Update, bounds); |
99 }, | 100 }, |
100 | 101 |
101 __proto__: WebInspector.Widget.prototype | 102 __proto__: WebInspector.Widget.prototype |
102 }; | 103 }; |
OLD | NEW |