| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @interface | 6 * @interface |
| 7 */ | 7 */ |
| 8 WebInspector.View = function() | 8 WebInspector.View = function() |
| 9 { | 9 { |
| 10 } | 10 }; |
| 11 | 11 |
| 12 WebInspector.View.prototype = { | 12 WebInspector.View.prototype = { |
| 13 /** | 13 /** |
| 14 * @return {string} | 14 * @return {string} |
| 15 */ | 15 */ |
| 16 viewId: function() { }, | 16 viewId: function() { }, |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * @return {string} | 19 * @return {string} |
| 20 */ | 20 */ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * @return {!Promise<!Array<!WebInspector.ToolbarItem>>} | 34 * @return {!Promise<!Array<!WebInspector.ToolbarItem>>} |
| 35 */ | 35 */ |
| 36 toolbarItems: function() { }, | 36 toolbarItems: function() { }, |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * @return {!Promise<!WebInspector.Widget>} | 39 * @return {!Promise<!WebInspector.Widget>} |
| 40 */ | 40 */ |
| 41 widget: function() { } | 41 widget: function() { } |
| 42 } | 42 }; |
| 43 | 43 |
| 44 WebInspector.View._symbol = Symbol("view"); | 44 WebInspector.View._symbol = Symbol("view"); |
| 45 WebInspector.View._widgetSymbol = Symbol("widget"); | 45 WebInspector.View._widgetSymbol = Symbol("widget"); |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * @constructor | 48 * @constructor |
| 49 * @extends {WebInspector.VBox} | 49 * @extends {WebInspector.VBox} |
| 50 * @implements {WebInspector.View} | 50 * @implements {WebInspector.View} |
| 51 * @param {string} title | 51 * @param {string} title |
| 52 * @param {boolean=} isWebComponent | 52 * @param {boolean=} isWebComponent |
| 53 */ | 53 */ |
| 54 WebInspector.SimpleView = function(title, isWebComponent) | 54 WebInspector.SimpleView = function(title, isWebComponent) |
| 55 { | 55 { |
| 56 WebInspector.VBox.call(this, isWebComponent); | 56 WebInspector.VBox.call(this, isWebComponent); |
| 57 this._title = title; | 57 this._title = title; |
| 58 /** @type {!Array<!WebInspector.ToolbarItem>} */ | 58 /** @type {!Array<!WebInspector.ToolbarItem>} */ |
| 59 this._toolbarItems = []; | 59 this._toolbarItems = []; |
| 60 this[WebInspector.View._symbol] = this; | 60 this[WebInspector.View._symbol] = this; |
| 61 } | 61 }; |
| 62 | 62 |
| 63 WebInspector.SimpleView.prototype = { | 63 WebInspector.SimpleView.prototype = { |
| 64 /** | 64 /** |
| 65 * @override | 65 * @override |
| 66 * @return {string} | 66 * @return {string} |
| 67 */ | 67 */ |
| 68 viewId: function() | 68 viewId: function() |
| 69 { | 69 { |
| 70 return this._title; | 70 return this._title; |
| 71 }, | 71 }, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * @return {!Promise} | 135 * @return {!Promise} |
| 136 */ | 136 */ |
| 137 revealView: function() | 137 revealView: function() |
| 138 { | 138 { |
| 139 return WebInspector.viewManager.revealView(this); | 139 return WebInspector.viewManager.revealView(this); |
| 140 }, | 140 }, |
| 141 | 141 |
| 142 __proto__: WebInspector.VBox.prototype | 142 __proto__: WebInspector.VBox.prototype |
| 143 } | 143 }; |
| 144 | 144 |
| 145 /** | 145 /** |
| 146 * @constructor | 146 * @constructor |
| 147 * @implements {WebInspector.View} | 147 * @implements {WebInspector.View} |
| 148 * @param {!Runtime.Extension} extension | 148 * @param {!Runtime.Extension} extension |
| 149 */ | 149 */ |
| 150 WebInspector.ProvidedView = function(extension) | 150 WebInspector.ProvidedView = function(extension) |
| 151 { | 151 { |
| 152 this._extension = extension; | 152 this._extension = extension; |
| 153 } | 153 }; |
| 154 | 154 |
| 155 WebInspector.ProvidedView.prototype = { | 155 WebInspector.ProvidedView.prototype = { |
| 156 /** | 156 /** |
| 157 * @override | 157 * @override |
| 158 * @return {string} | 158 * @return {string} |
| 159 */ | 159 */ |
| 160 viewId: function() | 160 viewId: function() |
| 161 { | 161 { |
| 162 return this._extension.descriptor()["id"]; | 162 return this._extension.descriptor()["id"]; |
| 163 }, | 163 }, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 190 }, | 190 }, |
| 191 | 191 |
| 192 /** | 192 /** |
| 193 * @override | 193 * @override |
| 194 * @return {!Promise<!Array<!WebInspector.ToolbarItem>>} | 194 * @return {!Promise<!Array<!WebInspector.ToolbarItem>>} |
| 195 */ | 195 */ |
| 196 toolbarItems: function() | 196 toolbarItems: function() |
| 197 { | 197 { |
| 198 var actionIds = this._extension.descriptor()["actionIds"]; | 198 var actionIds = this._extension.descriptor()["actionIds"]; |
| 199 if (actionIds) { | 199 if (actionIds) { |
| 200 var result = [] | 200 var result = []; |
| 201 for (var id of actionIds.split(",")) { | 201 for (var id of actionIds.split(",")) { |
| 202 var item = WebInspector.Toolbar.createActionButtonForId(id.trim(
)); | 202 var item = WebInspector.Toolbar.createActionButtonForId(id.trim(
)); |
| 203 if (item) | 203 if (item) |
| 204 result.push(item); | 204 result.push(item); |
| 205 } | 205 } |
| 206 return Promise.resolve(result); | 206 return Promise.resolve(result); |
| 207 } | 207 } |
| 208 | 208 |
| 209 if (this._extension.descriptor()["hasToolbar"]) | 209 if (this._extension.descriptor()["hasToolbar"]) |
| 210 return this.widget().then(widget => /** @type {!WebInspector.Toolbar
Item.ItemsProvider} */ (widget).toolbarItems()); | 210 return this.widget().then(widget => /** @type {!WebInspector.Toolbar
Item.ItemsProvider} */ (widget).toolbarItems()); |
| 211 return Promise.resolve([]); | 211 return Promise.resolve([]); |
| 212 }, | 212 }, |
| 213 | 213 |
| 214 /** | 214 /** |
| 215 * @override | 215 * @override |
| 216 * @return {!Promise<!WebInspector.Widget>} | 216 * @return {!Promise<!WebInspector.Widget>} |
| 217 */ | 217 */ |
| 218 widget: function() | 218 widget: function() |
| 219 { | 219 { |
| 220 return this._extension.instance().then(widget => { | 220 return this._extension.instance().then(widget => { |
| 221 if (!(widget instanceof WebInspector.Widget)) | 221 if (!(widget instanceof WebInspector.Widget)) |
| 222 throw new Error("view className should point to a WebInspector.W
idget"); | 222 throw new Error("view className should point to a WebInspector.W
idget"); |
| 223 widget[WebInspector.View._symbol] = this; | 223 widget[WebInspector.View._symbol] = this; |
| 224 return /** @type {!WebInspector.Widget} */ (widget); | 224 return /** @type {!WebInspector.Widget} */ (widget); |
| 225 }); | 225 }); |
| 226 } | 226 } |
| 227 } | 227 }; |
| 228 | 228 |
| 229 /** | 229 /** |
| 230 * @interface | 230 * @interface |
| 231 */ | 231 */ |
| 232 WebInspector.ViewLocation = function() { } | 232 WebInspector.ViewLocation = function() { }; |
| 233 | 233 |
| 234 WebInspector.ViewLocation.prototype = { | 234 WebInspector.ViewLocation.prototype = { |
| 235 /** | 235 /** |
| 236 * @param {string} locationName | 236 * @param {string} locationName |
| 237 */ | 237 */ |
| 238 appendApplicableItems: function(locationName) { }, | 238 appendApplicableItems: function(locationName) { }, |
| 239 | 239 |
| 240 /** | 240 /** |
| 241 * @param {!WebInspector.View} view | 241 * @param {!WebInspector.View} view |
| 242 * @param {?WebInspector.View=} insertBefore | 242 * @param {?WebInspector.View=} insertBefore |
| 243 */ | 243 */ |
| 244 appendView: function(view, insertBefore) { }, | 244 appendView: function(view, insertBefore) { }, |
| 245 | 245 |
| 246 /** | 246 /** |
| 247 * @param {!WebInspector.View} view | 247 * @param {!WebInspector.View} view |
| 248 * @param {?WebInspector.View=} insertBefore | 248 * @param {?WebInspector.View=} insertBefore |
| 249 * @return {!Promise} | 249 * @return {!Promise} |
| 250 */ | 250 */ |
| 251 showView: function(view, insertBefore) { }, | 251 showView: function(view, insertBefore) { }, |
| 252 | 252 |
| 253 /** | 253 /** |
| 254 * @param {!WebInspector.View} view | 254 * @param {!WebInspector.View} view |
| 255 */ | 255 */ |
| 256 removeView: function(view) { }, | 256 removeView: function(view) { }, |
| 257 | 257 |
| 258 /** | 258 /** |
| 259 * @return {!WebInspector.Widget} | 259 * @return {!WebInspector.Widget} |
| 260 */ | 260 */ |
| 261 widget: function() { } | 261 widget: function() { } |
| 262 } | 262 }; |
| 263 | 263 |
| 264 /** | 264 /** |
| 265 * @interface | 265 * @interface |
| 266 * @extends {WebInspector.ViewLocation} | 266 * @extends {WebInspector.ViewLocation} |
| 267 */ | 267 */ |
| 268 WebInspector.TabbedViewLocation = function() { } | 268 WebInspector.TabbedViewLocation = function() { }; |
| 269 | 269 |
| 270 WebInspector.TabbedViewLocation.prototype = { | 270 WebInspector.TabbedViewLocation.prototype = { |
| 271 /** | 271 /** |
| 272 * @return {!WebInspector.TabbedPane} | 272 * @return {!WebInspector.TabbedPane} |
| 273 */ | 273 */ |
| 274 tabbedPane: function() { }, | 274 tabbedPane: function() { }, |
| 275 | 275 |
| 276 enableMoreTabsButton: function() { } | 276 enableMoreTabsButton: function() { } |
| 277 } | 277 }; |
| 278 | 278 |
| 279 /** | 279 /** |
| 280 * @interface | 280 * @interface |
| 281 */ | 281 */ |
| 282 WebInspector.ViewLocationResolver = function() { } | 282 WebInspector.ViewLocationResolver = function() { }; |
| 283 | 283 |
| 284 WebInspector.ViewLocationResolver.prototype = { | 284 WebInspector.ViewLocationResolver.prototype = { |
| 285 /** | 285 /** |
| 286 * @param {string} location | 286 * @param {string} location |
| 287 * @return {?WebInspector.ViewLocation} | 287 * @return {?WebInspector.ViewLocation} |
| 288 */ | 288 */ |
| 289 resolveLocation: function(location) { } | 289 resolveLocation: function(location) { } |
| 290 } | 290 }; |
| 291 | 291 |
| 292 /** | 292 /** |
| 293 * @constructor | 293 * @constructor |
| 294 */ | 294 */ |
| 295 WebInspector.ViewManager = function() | 295 WebInspector.ViewManager = function() |
| 296 { | 296 { |
| 297 /** @type {!Map<string, !WebInspector.View>} */ | 297 /** @type {!Map<string, !WebInspector.View>} */ |
| 298 this._views = new Map(); | 298 this._views = new Map(); |
| 299 /** @type {!Map<string, string>} */ | 299 /** @type {!Map<string, string>} */ |
| 300 this._locationNameByViewId = new Map(); | 300 this._locationNameByViewId = new Map(); |
| 301 | 301 |
| 302 for (var extension of self.runtime.extensions("view")) { | 302 for (var extension of self.runtime.extensions("view")) { |
| 303 var descriptor = extension.descriptor(); | 303 var descriptor = extension.descriptor(); |
| 304 this._views.set(descriptor["id"], new WebInspector.ProvidedView(extensio
n)); | 304 this._views.set(descriptor["id"], new WebInspector.ProvidedView(extensio
n)); |
| 305 this._locationNameByViewId.set(descriptor["id"], descriptor["location"])
; | 305 this._locationNameByViewId.set(descriptor["id"], descriptor["location"])
; |
| 306 } | 306 } |
| 307 } | 307 }; |
| 308 | 308 |
| 309 WebInspector.ViewManager.prototype = { | 309 WebInspector.ViewManager.prototype = { |
| 310 /** | 310 /** |
| 311 * @param {!WebInspector.View} view | 311 * @param {!WebInspector.View} view |
| 312 * @return {!Promise} | 312 * @return {!Promise} |
| 313 */ | 313 */ |
| 314 revealView: function(view) | 314 revealView: function(view) |
| 315 { | 315 { |
| 316 var location = /** @type {?WebInspector.ViewManager._Location} */ (view[
WebInspector.ViewManager._Location.symbol]); | 316 var location = /** @type {?WebInspector.ViewManager._Location} */ (view[
WebInspector.ViewManager._Location.symbol]); |
| 317 if (!location) | 317 if (!location) |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 */ | 413 */ |
| 414 _viewsForLocation: function(location) | 414 _viewsForLocation: function(location) |
| 415 { | 415 { |
| 416 var result = []; | 416 var result = []; |
| 417 for (var id of this._views.keys()) { | 417 for (var id of this._views.keys()) { |
| 418 if (this._locationNameByViewId.get(id) === location) | 418 if (this._locationNameByViewId.get(id) === location) |
| 419 result.push(this._views.get(id)); | 419 result.push(this._views.get(id)); |
| 420 } | 420 } |
| 421 return result; | 421 return result; |
| 422 } | 422 } |
| 423 } | 423 }; |
| 424 | 424 |
| 425 | 425 |
| 426 /** | 426 /** |
| 427 * @param {!Element} element | 427 * @param {!Element} element |
| 428 * @param {!Array<!WebInspector.ToolbarItem>} toolbarItems | 428 * @param {!Array<!WebInspector.ToolbarItem>} toolbarItems |
| 429 */ | 429 */ |
| 430 WebInspector.ViewManager._populateToolbar = function(element, toolbarItems) | 430 WebInspector.ViewManager._populateToolbar = function(element, toolbarItems) |
| 431 { | 431 { |
| 432 if (!toolbarItems.length) | 432 if (!toolbarItems.length) |
| 433 return; | 433 return; |
| 434 var toolbar = new WebInspector.Toolbar(""); | 434 var toolbar = new WebInspector.Toolbar(""); |
| 435 element.insertBefore(toolbar.element, element.firstChild); | 435 element.insertBefore(toolbar.element, element.firstChild); |
| 436 for (var item of toolbarItems) | 436 for (var item of toolbarItems) |
| 437 toolbar.appendToolbarItem(item); | 437 toolbar.appendToolbarItem(item); |
| 438 } | 438 }; |
| 439 | 439 |
| 440 /** | 440 /** |
| 441 * @constructor | 441 * @constructor |
| 442 * @extends {WebInspector.VBox} | 442 * @extends {WebInspector.VBox} |
| 443 * @param {!WebInspector.View} view | 443 * @param {!WebInspector.View} view |
| 444 */ | 444 */ |
| 445 WebInspector.ViewManager._ContainerWidget = function(view) | 445 WebInspector.ViewManager._ContainerWidget = function(view) |
| 446 { | 446 { |
| 447 WebInspector.VBox.call(this); | 447 WebInspector.VBox.call(this); |
| 448 this.element.classList.add("flex-auto", "view-container", "overflow-auto"); | 448 this.element.classList.add("flex-auto", "view-container", "overflow-auto"); |
| 449 this._view = view; | 449 this._view = view; |
| 450 this.element.tabIndex = 0; | 450 this.element.tabIndex = 0; |
| 451 this.setDefaultFocusedElement(this.element); | 451 this.setDefaultFocusedElement(this.element); |
| 452 } | 452 }; |
| 453 | 453 |
| 454 WebInspector.ViewManager._ContainerWidget.prototype = { | 454 WebInspector.ViewManager._ContainerWidget.prototype = { |
| 455 /** | 455 /** |
| 456 * @return {!Promise} | 456 * @return {!Promise} |
| 457 */ | 457 */ |
| 458 _materialize: function() | 458 _materialize: function() |
| 459 { | 459 { |
| 460 if (this._materializePromise) | 460 if (this._materializePromise) |
| 461 return this._materializePromise; | 461 return this._materializePromise; |
| 462 var promises = []; | 462 var promises = []; |
| 463 promises.push(this._view.toolbarItems().then(WebInspector.ViewManager._p
opulateToolbar.bind(WebInspector.ViewManager, this.element))); | 463 promises.push(this._view.toolbarItems().then(WebInspector.ViewManager._p
opulateToolbar.bind(WebInspector.ViewManager, this.element))); |
| 464 promises.push(this._view.widget().then(widget => { | 464 promises.push(this._view.widget().then(widget => { |
| 465 // Move focus from |this| to loaded |widget| if any. | 465 // Move focus from |this| to loaded |widget| if any. |
| 466 var shouldFocus = this.element.hasFocus(); | 466 var shouldFocus = this.element.hasFocus(); |
| 467 this.setDefaultFocusedElement(null); | 467 this.setDefaultFocusedElement(null); |
| 468 this._view[WebInspector.View._widgetSymbol] = widget; | 468 this._view[WebInspector.View._widgetSymbol] = widget; |
| 469 widget.show(this.element); | 469 widget.show(this.element); |
| 470 if (shouldFocus) | 470 if (shouldFocus) |
| 471 widget.focus(); | 471 widget.focus(); |
| 472 })); | 472 })); |
| 473 this._materializePromise = Promise.all(promises); | 473 this._materializePromise = Promise.all(promises); |
| 474 return this._materializePromise; | 474 return this._materializePromise; |
| 475 }, | 475 }, |
| 476 | 476 |
| 477 __proto__: WebInspector.VBox.prototype | 477 __proto__: WebInspector.VBox.prototype |
| 478 } | 478 }; |
| 479 | 479 |
| 480 /** | 480 /** |
| 481 * @constructor | 481 * @constructor |
| 482 * @extends {WebInspector.VBox} | 482 * @extends {WebInspector.VBox} |
| 483 * @param {!WebInspector.View} view | 483 * @param {!WebInspector.View} view |
| 484 */ | 484 */ |
| 485 WebInspector.ViewManager._ExpandableContainerWidget = function(view) | 485 WebInspector.ViewManager._ExpandableContainerWidget = function(view) |
| 486 { | 486 { |
| 487 WebInspector.VBox.call(this, true); | 487 WebInspector.VBox.call(this, true); |
| 488 this.element.classList.add("flex-none"); | 488 this.element.classList.add("flex-none"); |
| 489 this.registerRequiredCSS("ui/viewContainers.css"); | 489 this.registerRequiredCSS("ui/viewContainers.css"); |
| 490 | 490 |
| 491 this._titleElement = createElementWithClass("div", "expandable-view-title"); | 491 this._titleElement = createElementWithClass("div", "expandable-view-title"); |
| 492 this._titleElement.textContent = view.title(); | 492 this._titleElement.textContent = view.title(); |
| 493 this._titleElement.tabIndex = 0; | 493 this._titleElement.tabIndex = 0; |
| 494 this._titleElement.addEventListener("click", this._toggleExpanded.bind(this)
, false); | 494 this._titleElement.addEventListener("click", this._toggleExpanded.bind(this)
, false); |
| 495 this._titleElement.addEventListener("keydown", this._onTitleKeyDown.bind(thi
s), false); | 495 this._titleElement.addEventListener("keydown", this._onTitleKeyDown.bind(thi
s), false); |
| 496 this.contentElement.insertBefore(this._titleElement, this.contentElement.fir
stChild); | 496 this.contentElement.insertBefore(this._titleElement, this.contentElement.fir
stChild); |
| 497 | 497 |
| 498 this.contentElement.createChild("content"); | 498 this.contentElement.createChild("content"); |
| 499 this._view = view; | 499 this._view = view; |
| 500 view[WebInspector.ViewManager._ExpandableContainerWidget._symbol] = this; | 500 view[WebInspector.ViewManager._ExpandableContainerWidget._symbol] = this; |
| 501 } | 501 }; |
| 502 | 502 |
| 503 WebInspector.ViewManager._ExpandableContainerWidget._symbol = Symbol("container"
); | 503 WebInspector.ViewManager._ExpandableContainerWidget._symbol = Symbol("container"
); |
| 504 | 504 |
| 505 WebInspector.ViewManager._ExpandableContainerWidget.prototype = { | 505 WebInspector.ViewManager._ExpandableContainerWidget.prototype = { |
| 506 /** | 506 /** |
| 507 * @return {!Promise} | 507 * @return {!Promise} |
| 508 */ | 508 */ |
| 509 _materialize: function() | 509 _materialize: function() |
| 510 { | 510 { |
| 511 if (this._materializePromise) | 511 if (this._materializePromise) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 /** | 551 /** |
| 552 * @param {!Event} event | 552 * @param {!Event} event |
| 553 */ | 553 */ |
| 554 _onTitleKeyDown: function(event) | 554 _onTitleKeyDown: function(event) |
| 555 { | 555 { |
| 556 if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut
.Keys.Space.code) | 556 if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut
.Keys.Space.code) |
| 557 this._toggleExpanded(); | 557 this._toggleExpanded(); |
| 558 }, | 558 }, |
| 559 | 559 |
| 560 __proto__: WebInspector.VBox.prototype | 560 __proto__: WebInspector.VBox.prototype |
| 561 } | 561 }; |
| 562 | 562 |
| 563 /** | 563 /** |
| 564 * @constructor | 564 * @constructor |
| 565 * @param {!WebInspector.ViewManager} manager | 565 * @param {!WebInspector.ViewManager} manager |
| 566 * @param {!WebInspector.Widget} widget | 566 * @param {!WebInspector.Widget} widget |
| 567 * @param {function()=} revealCallback | 567 * @param {function()=} revealCallback |
| 568 */ | 568 */ |
| 569 WebInspector.ViewManager._Location = function(manager, widget, revealCallback) | 569 WebInspector.ViewManager._Location = function(manager, widget, revealCallback) |
| 570 { | 570 { |
| 571 this._manager = manager; | 571 this._manager = manager; |
| 572 this._revealCallback = revealCallback; | 572 this._revealCallback = revealCallback; |
| 573 this._widget = widget; | 573 this._widget = widget; |
| 574 } | 574 }; |
| 575 | 575 |
| 576 WebInspector.ViewManager._Location.symbol = Symbol("location"); | 576 WebInspector.ViewManager._Location.symbol = Symbol("location"); |
| 577 | 577 |
| 578 WebInspector.ViewManager._Location.prototype = { | 578 WebInspector.ViewManager._Location.prototype = { |
| 579 /** | 579 /** |
| 580 * @return {!WebInspector.Widget} | 580 * @return {!WebInspector.Widget} |
| 581 */ | 581 */ |
| 582 widget: function() | 582 widget: function() |
| 583 { | 583 { |
| 584 return this._widget; | 584 return this._widget; |
| 585 }, | 585 }, |
| 586 | 586 |
| 587 _reveal: function() | 587 _reveal: function() |
| 588 { | 588 { |
| 589 if (this._revealCallback) | 589 if (this._revealCallback) |
| 590 this._revealCallback(); | 590 this._revealCallback(); |
| 591 } | 591 } |
| 592 } | 592 }; |
| 593 | 593 |
| 594 /** | 594 /** |
| 595 * @constructor | 595 * @constructor |
| 596 * @extends {WebInspector.ViewManager._Location} | 596 * @extends {WebInspector.ViewManager._Location} |
| 597 * @implements {WebInspector.TabbedViewLocation} | 597 * @implements {WebInspector.TabbedViewLocation} |
| 598 * @param {!WebInspector.ViewManager} manager | 598 * @param {!WebInspector.ViewManager} manager |
| 599 * @param {function()=} revealCallback | 599 * @param {function()=} revealCallback |
| 600 * @param {string=} location | 600 * @param {string=} location |
| 601 * @param {boolean=} restoreSelection | 601 * @param {boolean=} restoreSelection |
| 602 * @param {boolean=} allowReorder | 602 * @param {boolean=} allowReorder |
| (...skipping 12 matching lines...) Expand all Loading... |
| 615 this._tabOrderSetting = WebInspector.settings.createSetting(location + "-tab
Order", {}); | 615 this._tabOrderSetting = WebInspector.settings.createSetting(location + "-tab
Order", {}); |
| 616 this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabOrderCha
nged, this._persistTabOrder, this); | 616 this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabOrderCha
nged, this._persistTabOrder, this); |
| 617 if (restoreSelection) | 617 if (restoreSelection) |
| 618 this._lastSelectedTabSetting = WebInspector.settings.createSetting(locat
ion + "-selectedTab", ""); | 618 this._lastSelectedTabSetting = WebInspector.settings.createSetting(locat
ion + "-selectedTab", ""); |
| 619 | 619 |
| 620 /** @type {!Map.<string, !WebInspector.View>} */ | 620 /** @type {!Map.<string, !WebInspector.View>} */ |
| 621 this._views = new Map(); | 621 this._views = new Map(); |
| 622 | 622 |
| 623 if (location) | 623 if (location) |
| 624 this.appendApplicableItems(location); | 624 this.appendApplicableItems(location); |
| 625 } | 625 }; |
| 626 | 626 |
| 627 WebInspector.ViewManager._TabbedLocation.orderStep = 10; // Keep in sync with d
escriptors. | 627 WebInspector.ViewManager._TabbedLocation.orderStep = 10; // Keep in sync with d
escriptors. |
| 628 | 628 |
| 629 WebInspector.ViewManager._TabbedLocation.prototype = { | 629 WebInspector.ViewManager._TabbedLocation.prototype = { |
| 630 /** | 630 /** |
| 631 * @override | 631 * @override |
| 632 * @return {!WebInspector.Widget} | 632 * @return {!WebInspector.Widget} |
| 633 */ | 633 */ |
| 634 widget: function() | 634 widget: function() |
| 635 { | 635 { |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 _persistTabOrder: function(event) | 822 _persistTabOrder: function(event) |
| 823 { | 823 { |
| 824 var tabIds = this._tabbedPane.tabIds(); | 824 var tabIds = this._tabbedPane.tabIds(); |
| 825 var tabOrders = {}; | 825 var tabOrders = {}; |
| 826 for (var i = 0; i < tabIds.length; i++) | 826 for (var i = 0; i < tabIds.length; i++) |
| 827 tabOrders[tabIds[i]] = (i + 1) * WebInspector.ViewManager._TabbedLoc
ation.orderStep; | 827 tabOrders[tabIds[i]] = (i + 1) * WebInspector.ViewManager._TabbedLoc
ation.orderStep; |
| 828 this._tabOrderSetting.set(tabOrders); | 828 this._tabOrderSetting.set(tabOrders); |
| 829 }, | 829 }, |
| 830 | 830 |
| 831 __proto__: WebInspector.ViewManager._Location.prototype | 831 __proto__: WebInspector.ViewManager._Location.prototype |
| 832 } | 832 }; |
| 833 | 833 |
| 834 /** | 834 /** |
| 835 * @constructor | 835 * @constructor |
| 836 * @extends {WebInspector.ViewManager._Location} | 836 * @extends {WebInspector.ViewManager._Location} |
| 837 * @implements {WebInspector.ViewLocation} | 837 * @implements {WebInspector.ViewLocation} |
| 838 * @param {!WebInspector.ViewManager} manager | 838 * @param {!WebInspector.ViewManager} manager |
| 839 * @param {function()=} revealCallback | 839 * @param {function()=} revealCallback |
| 840 * @param {string=} location | 840 * @param {string=} location |
| 841 */ | 841 */ |
| 842 WebInspector.ViewManager._StackLocation = function(manager, revealCallback, loca
tion) | 842 WebInspector.ViewManager._StackLocation = function(manager, revealCallback, loca
tion) |
| 843 { | 843 { |
| 844 this._vbox = new WebInspector.VBox(); | 844 this._vbox = new WebInspector.VBox(); |
| 845 WebInspector.ViewManager._Location.call(this, manager, this._vbox, revealCal
lback); | 845 WebInspector.ViewManager._Location.call(this, manager, this._vbox, revealCal
lback); |
| 846 | 846 |
| 847 /** @type {!Map<string, !WebInspector.ViewManager._ExpandableContainerWidget
>} */ | 847 /** @type {!Map<string, !WebInspector.ViewManager._ExpandableContainerWidget
>} */ |
| 848 this._expandableContainers = new Map(); | 848 this._expandableContainers = new Map(); |
| 849 | 849 |
| 850 if (location) | 850 if (location) |
| 851 this.appendApplicableItems(location); | 851 this.appendApplicableItems(location); |
| 852 } | 852 }; |
| 853 | 853 |
| 854 WebInspector.ViewManager._StackLocation.prototype = { | 854 WebInspector.ViewManager._StackLocation.prototype = { |
| 855 | 855 |
| 856 /** | 856 /** |
| 857 * @override | 857 * @override |
| 858 * @param {!WebInspector.View} view | 858 * @param {!WebInspector.View} view |
| 859 * @param {?WebInspector.View=} insertBefore | 859 * @param {?WebInspector.View=} insertBefore |
| 860 */ | 860 */ |
| 861 appendView: function(view, insertBefore) | 861 appendView: function(view, insertBefore) |
| 862 { | 862 { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 * @override | 908 * @override |
| 909 * @param {string} locationName | 909 * @param {string} locationName |
| 910 */ | 910 */ |
| 911 appendApplicableItems: function(locationName) | 911 appendApplicableItems: function(locationName) |
| 912 { | 912 { |
| 913 for (var view of this._manager._viewsForLocation(locationName)) | 913 for (var view of this._manager._viewsForLocation(locationName)) |
| 914 this.appendView(view); | 914 this.appendView(view); |
| 915 }, | 915 }, |
| 916 | 916 |
| 917 __proto__: WebInspector.ViewManager._Location.prototype | 917 __proto__: WebInspector.ViewManager._Location.prototype |
| 918 } | 918 }; |
| 919 | 919 |
| 920 /** | 920 /** |
| 921 * @type {!WebInspector.ViewManager} | 921 * @type {!WebInspector.ViewManager} |
| 922 */ | 922 */ |
| 923 WebInspector.viewManager; | 923 WebInspector.viewManager; |
| OLD | NEW |