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 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 WebInspector.ActionRegistry = class { | 7 WebInspector.ActionRegistry = class { |
8 constructor() { | 8 constructor() { |
9 /** @type {!Map.<string, !WebInspector.Action>} */ | 9 /** @type {!Map.<string, !WebInspector.Action>} */ |
10 this._actionsById = new Map(); | 10 this._actionsById = new Map(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 /** | 108 /** |
109 * @return {string} | 109 * @return {string} |
110 */ | 110 */ |
111 icon() { | 111 icon() { |
112 return this._extension.descriptor()['iconClass'] || ''; | 112 return this._extension.descriptor()['iconClass'] || ''; |
113 } | 113 } |
114 | 114 |
115 /** | 115 /** |
| 116 * @return {string} |
| 117 */ |
| 118 toggledIcon() { |
| 119 return this._extension.descriptor()['toggledIconClass'] || ''; |
| 120 } |
| 121 |
| 122 /** |
| 123 * @return {boolean} |
| 124 */ |
| 125 toggleWithRedColor() { |
| 126 return !!this._extension.descriptor()['toggleWithRedColor']; |
| 127 } |
| 128 |
| 129 /** |
116 * @param {boolean} enabled | 130 * @param {boolean} enabled |
117 */ | 131 */ |
118 setEnabled(enabled) { | 132 setEnabled(enabled) { |
119 if (this._enabled === enabled) | 133 if (this._enabled === enabled) |
120 return; | 134 return; |
121 | 135 |
122 this._enabled = enabled; | 136 this._enabled = enabled; |
123 this.dispatchEventToListeners(WebInspector.Action.Events.Enabled, enabled); | 137 this.dispatchEventToListeners(WebInspector.Action.Events.Enabled, enabled); |
124 } | 138 } |
125 | 139 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 /** | 207 /** |
194 * @param {!WebInspector.Context} context | 208 * @param {!WebInspector.Context} context |
195 * @param {string} actionId | 209 * @param {string} actionId |
196 * @return {boolean} | 210 * @return {boolean} |
197 */ | 211 */ |
198 handleAction: function(context, actionId) {} | 212 handleAction: function(context, actionId) {} |
199 }; | 213 }; |
200 | 214 |
201 /** @type {!WebInspector.ActionRegistry} */ | 215 /** @type {!WebInspector.ActionRegistry} */ |
202 WebInspector.actionRegistry; | 216 WebInspector.actionRegistry; |
OLD | NEW |