| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * @extends {WebInspector.VBox} | 33 * @extends {WebInspector.VBox} |
| 34 * @constructor | 34 * @constructor |
| 35 */ | 35 */ |
| 36 WebInspector.Panel = function(name) | 36 WebInspector.Panel = function(name) |
| 37 { | 37 { |
| 38 WebInspector.VBox.call(this); | 38 WebInspector.VBox.call(this); |
| 39 | 39 |
| 40 this.element.classList.add("panel"); | 40 this.element.classList.add("panel"); |
| 41 this.element.setAttribute("role", "tabpanel"); | |
| 42 this.element.setAttribute("aria-label", name); | 41 this.element.setAttribute("aria-label", name); |
| 43 this.element.classList.add(name); | 42 this.element.classList.add(name); |
| 44 this._panelName = name; | 43 this._panelName = name; |
| 45 | 44 |
| 46 // For testing. | 45 // For testing. |
| 47 WebInspector.panels[name] = this; | 46 WebInspector.panels[name] = this; |
| 48 | 47 |
| 49 this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}); | 48 this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}); |
| 50 } | 49 } |
| 51 | 50 |
| 52 // Should by in sync with style declarations. | 51 // Should by in sync with style declarations. |
| 53 WebInspector.Panel.counterRightMargin = 25; | 52 WebInspector.Panel.counterRightMargin = 25; |
| 54 | 53 |
| 55 WebInspector.Panel.prototype = { | 54 WebInspector.Panel.prototype = { |
| 56 get name() | 55 get name() |
| 57 { | 56 { |
| 58 return this._panelName; | 57 return this._panelName; |
| 59 }, | 58 }, |
| 60 | 59 |
| 61 reset: function() | |
| 62 { | |
| 63 }, | |
| 64 | |
| 65 /** | 60 /** |
| 66 * @return {?WebInspector.SearchableView} | 61 * @return {?WebInspector.SearchableView} |
| 67 */ | 62 */ |
| 68 searchableView: function() | 63 searchableView: function() |
| 69 { | 64 { |
| 70 return null; | 65 return null; |
| 71 }, | 66 }, |
| 72 | 67 |
| 73 /** | 68 /** |
| 74 * @override | 69 * @override |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 /** | 164 /** |
| 170 * @return {!WebInspector.SplitWidget} | 165 * @return {!WebInspector.SplitWidget} |
| 171 */ | 166 */ |
| 172 splitWidget: function() | 167 splitWidget: function() |
| 173 { | 168 { |
| 174 return this._panelSplitWidget; | 169 return this._panelSplitWidget; |
| 175 }, | 170 }, |
| 176 | 171 |
| 177 __proto__: WebInspector.Panel.prototype | 172 __proto__: WebInspector.Panel.prototype |
| 178 } | 173 } |
| 179 | |
| 180 /** | |
| 181 * @interface | |
| 182 */ | |
| 183 WebInspector.PanelDescriptor = function() | |
| 184 { | |
| 185 } | |
| 186 | |
| 187 WebInspector.PanelDescriptor.prototype = { | |
| 188 /** | |
| 189 * @return {string} | |
| 190 */ | |
| 191 name: function() {}, | |
| 192 | |
| 193 /** | |
| 194 * @return {string} | |
| 195 */ | |
| 196 title: function() {}, | |
| 197 | |
| 198 /** | |
| 199 * @return {!Promise.<!WebInspector.Panel>} | |
| 200 */ | |
| 201 panel: function() {} | |
| 202 } | |
| 203 | |
| 204 /** | |
| 205 * @constructor | |
| 206 * @param {!Runtime.Extension} extension | |
| 207 * @implements {WebInspector.PanelDescriptor} | |
| 208 */ | |
| 209 WebInspector.ExtensionPanelDescriptor = function(extension) | |
| 210 { | |
| 211 this._name = extension.descriptor()["name"]; | |
| 212 this._title = WebInspector.UIString(extension.descriptor()["title"]); | |
| 213 this._extension = extension; | |
| 214 } | |
| 215 | |
| 216 WebInspector.ExtensionPanelDescriptor.prototype = { | |
| 217 /** | |
| 218 * @override | |
| 219 * @return {string} | |
| 220 */ | |
| 221 name: function() | |
| 222 { | |
| 223 return this._name; | |
| 224 }, | |
| 225 | |
| 226 /** | |
| 227 * @override | |
| 228 * @return {string} | |
| 229 */ | |
| 230 title: function() | |
| 231 { | |
| 232 return this._title; | |
| 233 }, | |
| 234 | |
| 235 /** | |
| 236 * @override | |
| 237 * @return {!Promise.<!WebInspector.Panel>} | |
| 238 */ | |
| 239 panel: function() | |
| 240 { | |
| 241 return /** @type {!Promise<!WebInspector.Panel>} */(this._extension.ins
tance()); | |
| 242 } | |
| 243 } | |
| OLD | NEW |