OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 this._domStorageTreeElements = new Map(); | 95 this._domStorageTreeElements = new Map(); |
96 /** @type {!Object.<string, !WebInspector.CookieItemsView>} */ | 96 /** @type {!Object.<string, !WebInspector.CookieItemsView>} */ |
97 this._cookieViews = {}; | 97 this._cookieViews = {}; |
98 /** @type {!Object.<string, boolean>} */ | 98 /** @type {!Object.<string, boolean>} */ |
99 this._domains = {}; | 99 this._domains = {}; |
100 | 100 |
101 this.sidebarElement().addEventListener("mousemove", this._onmousemove.bind(t
his), false); | 101 this.sidebarElement().addEventListener("mousemove", this._onmousemove.bind(t
his), false); |
102 this.sidebarElement().addEventListener("mouseout", this._onmouseout.bind(thi
s), false); | 102 this.sidebarElement().addEventListener("mouseout", this._onmouseout.bind(thi
s), false); |
103 | 103 |
104 /** | 104 /** |
105 * @return {!WebInspector.View} | |
106 * @this {WebInspector.ResourcesPanel} | 105 * @this {WebInspector.ResourcesPanel} |
| 106 * @return {?WebInspector.SourceFrame} |
107 */ | 107 */ |
108 function viewGetter() | 108 function sourceFrameGetter() |
109 { | 109 { |
110 return this.visibleView; | 110 var view = this.visibleView; |
| 111 if (view && view instanceof WebInspector.SourceFrame) |
| 112 return /** @type {!WebInspector.SourceFrame} */ (view); |
| 113 return null; |
111 } | 114 } |
112 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); | 115 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this)); |
113 | 116 |
114 if (WebInspector.resourceTreeModel.cachedResourcesLoaded()) | 117 if (WebInspector.resourceTreeModel.cachedResourcesLoaded()) |
115 this._cachedResourcesLoaded(); | 118 this._cachedResourcesLoaded(); |
116 | 119 |
117 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.Load, this._loadEventFired, this); | 120 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.Load, this._loadEventFired, this); |
118 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.CachedResourcesLoaded, this._cachedResourcesLoaded, this); | 121 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.CachedResourcesLoaded, this._cachedResourcesLoaded, this); |
119 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.WillLoadCachedResources, this._resetWithFrames, this); | 122 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.WillLoadCachedResources, this._resetWithFrames, this); |
120 | 123 |
121 WebInspector.databaseModel.databases().forEach(this._addDatabase.bind(this))
; | 124 WebInspector.databaseModel.databases().forEach(this._addDatabase.bind(this))
; |
122 WebInspector.databaseModel.addEventListener(WebInspector.DatabaseModel.Event
s.DatabaseAdded, this._databaseAdded, this); | 125 WebInspector.databaseModel.addEventListener(WebInspector.DatabaseModel.Event
s.DatabaseAdded, this._databaseAdded, this); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 * @param {number=} column | 421 * @param {number=} column |
419 * @return {boolean} | 422 * @return {boolean} |
420 */ | 423 */ |
421 showResource: function(resource, line, column) | 424 showResource: function(resource, line, column) |
422 { | 425 { |
423 var resourceTreeElement = this._findTreeElementForResource(resource); | 426 var resourceTreeElement = this._findTreeElementForResource(resource); |
424 if (resourceTreeElement) | 427 if (resourceTreeElement) |
425 resourceTreeElement.revealAndSelect(true); | 428 resourceTreeElement.revealAndSelect(true); |
426 | 429 |
427 if (typeof line === "number") { | 430 if (typeof line === "number") { |
428 var view = this._resourceViewForResource(resource); | 431 var resourceSourceFrame = this._resourceSourceFrameViewForResource(r
esource); |
429 if (view.canHighlightPosition()) | 432 if (resourceSourceFrame) |
430 view.highlightPosition(line, column); | 433 resourceSourceFrame.revealPosition(line, column, true); |
431 } | 434 } |
432 return true; | 435 return true; |
433 }, | 436 }, |
434 | 437 |
435 _showResourceView: function(resource) | 438 _showResourceView: function(resource) |
436 { | 439 { |
437 var view = this._resourceViewForResource(resource); | 440 var view = this._resourceViewForResource(resource); |
438 if (!view) { | 441 if (!view) { |
439 this.visibleView.detach(); | 442 this.visibleView.detach(); |
440 return; | 443 return; |
441 } | 444 } |
442 this._innerShowView(view); | 445 this._innerShowView(view); |
443 }, | 446 }, |
444 | 447 |
| 448 /** |
| 449 * @param {!WebInspector.Resource} resource |
| 450 * @return {?WebInspector.View} |
| 451 */ |
445 _resourceViewForResource: function(resource) | 452 _resourceViewForResource: function(resource) |
446 { | 453 { |
447 if (WebInspector.ResourceView.hasTextContent(resource)) { | 454 if (WebInspector.ResourceView.hasTextContent(resource)) { |
448 var treeElement = this._findTreeElementForResource(resource); | 455 var treeElement = this._findTreeElementForResource(resource); |
449 if (!treeElement) | 456 if (!treeElement) |
450 return null; | 457 return null; |
451 return treeElement.sourceView(); | 458 return treeElement.sourceView(); |
452 } | 459 } |
453 return WebInspector.ResourceView.nonSourceViewForResource(resource); | 460 return WebInspector.ResourceView.nonSourceViewForResource(resource); |
454 }, | 461 }, |
455 | 462 |
456 /** | 463 /** |
| 464 * @param {!WebInspector.Resource} resource |
| 465 * @return {?WebInspector.ResourceSourceFrame} |
| 466 */ |
| 467 _resourceSourceFrameViewForResource: function(resource) |
| 468 { |
| 469 var resourceView = this._resourceViewForResource(resource); |
| 470 if (resourceView && resourceView instanceof WebInspector.ResourceSourceF
rame) |
| 471 return /** @type {!WebInspector.ResourceSourceFrame} */ (resourceVie
w); |
| 472 return null; |
| 473 }, |
| 474 |
| 475 /** |
457 * @param {!WebInspector.Database} database | 476 * @param {!WebInspector.Database} database |
458 * @param {string=} tableName | 477 * @param {string=} tableName |
459 */ | 478 */ |
460 _showDatabase: function(database, tableName) | 479 _showDatabase: function(database, tableName) |
461 { | 480 { |
462 if (!database) | 481 if (!database) |
463 return; | 482 return; |
464 | 483 |
465 var view; | 484 var view; |
466 if (tableName) { | 485 if (tableName) { |
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 } | 2101 } |
2083 | 2102 |
2084 WebInspector.StorageCategoryView.prototype = { | 2103 WebInspector.StorageCategoryView.prototype = { |
2085 setText: function(text) | 2104 setText: function(text) |
2086 { | 2105 { |
2087 this._emptyView.text = text; | 2106 this._emptyView.text = text; |
2088 }, | 2107 }, |
2089 | 2108 |
2090 __proto__: WebInspector.VBox.prototype | 2109 __proto__: WebInspector.VBox.prototype |
2091 } | 2110 } |
OLD | NEW |