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.Object} | 7 * @extends {WebInspector.Object} |
8 * @param {!Window} window | 8 * @param {!Window} window |
9 * @param {!InspectorFrontendHostAPI} frontendHost | 9 * @param {!InspectorFrontendHostAPI} frontendHost |
10 */ | 10 */ |
11 WebInspector.ZoomManager = function(window, frontendHost) | 11 WebInspector.ZoomManager = function(window, frontendHost) |
12 { | 12 { |
13 this._frontendHost = frontendHost; | 13 this._frontendHost = frontendHost; |
14 this._zoomFactor = this._frontendHost.zoomFactor(); | 14 this._zoomFactor = this._frontendHost.zoomFactor(); |
15 window.addEventListener("resize", this._onWindowResize.bind(this), true); | 15 window.addEventListener("resize", this._onWindowResize.bind(this), true); |
16 }; | 16 }; |
17 | 17 |
| 18 /** @enum {symbol} */ |
18 WebInspector.ZoomManager.Events = { | 19 WebInspector.ZoomManager.Events = { |
19 ZoomChanged: "ZoomChanged" | 20 ZoomChanged: Symbol("ZoomChanged") |
20 }; | 21 }; |
21 | 22 |
22 WebInspector.ZoomManager.prototype = { | 23 WebInspector.ZoomManager.prototype = { |
23 /** | 24 /** |
24 * @return {number} | 25 * @return {number} |
25 */ | 26 */ |
26 zoomFactor: function() | 27 zoomFactor: function() |
27 { | 28 { |
28 return this._zoomFactor; | 29 return this._zoomFactor; |
29 }, | 30 }, |
(...skipping 24 matching lines...) Expand all Loading... |
54 this.dispatchEventToListeners(WebInspector.ZoomManager.Events.ZoomCh
anged, {from: oldZoomFactor, to: this._zoomFactor}); | 55 this.dispatchEventToListeners(WebInspector.ZoomManager.Events.ZoomCh
anged, {from: oldZoomFactor, to: this._zoomFactor}); |
55 }, | 56 }, |
56 | 57 |
57 __proto__: WebInspector.Object.prototype | 58 __proto__: WebInspector.Object.prototype |
58 }; | 59 }; |
59 | 60 |
60 /** | 61 /** |
61 * @type {!WebInspector.ZoomManager} | 62 * @type {!WebInspector.ZoomManager} |
62 */ | 63 */ |
63 WebInspector.zoomManager; | 64 WebInspector.zoomManager; |
OLD | NEW |