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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ActionRegistry.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 */ 7 */
8 WebInspector.ActionRegistry = function() 8 WebInspector.ActionRegistry = function()
9 { 9 {
10 /** @type {!Map.<string, !WebInspector.Action>} */ 10 /** @type {!Map.<string, !WebInspector.Action>} */
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 * @param {!Runtime.Extension} extension 80 * @param {!Runtime.Extension} extension
81 */ 81 */
82 WebInspector.Action = function(extension) 82 WebInspector.Action = function(extension)
83 { 83 {
84 WebInspector.Object.call(this); 84 WebInspector.Object.call(this);
85 this._extension = extension; 85 this._extension = extension;
86 this._enabled = true; 86 this._enabled = true;
87 this._toggled = false; 87 this._toggled = false;
88 } 88 }
89 89
90 /** @enum {symbol} */
90 WebInspector.Action.Events = { 91 WebInspector.Action.Events = {
91 Enabled: "Enabled", 92 Enabled: Symbol("Enabled"),
92 Toggled: "Toggled" 93 Toggled: Symbol("Toggled")
93 } 94 }
94 95
95 WebInspector.Action.prototype = { 96 WebInspector.Action.prototype = {
96 /** 97 /**
97 * @return {string} 98 * @return {string}
98 */ 99 */
99 id: function() 100 id: function()
100 { 101 {
101 return this._extension.descriptor()["actionId"]; 102 return this._extension.descriptor()["actionId"];
102 }, 103 },
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 /** 216 /**
216 * @param {!WebInspector.Context} context 217 * @param {!WebInspector.Context} context
217 * @param {string} actionId 218 * @param {string} actionId
218 * @return {boolean} 219 * @return {boolean}
219 */ 220 */
220 handleAction: function(context, actionId) {} 221 handleAction: function(context, actionId) {}
221 } 222 }
222 223
223 /** @type {!WebInspector.ActionRegistry} */ 224 /** @type {!WebInspector.ActionRegistry} */
224 WebInspector.actionRegistry; 225 WebInspector.actionRegistry;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698