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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ZoomManager.js

Issue 2261933002: DevTools: Use JS symbols instead of strings for eligible events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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.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
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;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698