Changeset 96577 in webkit
- Timestamp:
- Oct 4, 2011 2:17:08 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96576 r96577 1 2011-10-04 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: remove dependency from GoToLine dialog from Panel. 4 https://bugs.webkit.org/show_bug.cgi?id=69327 5 6 Reviewed by Yury Semikhatsky. 7 8 * inspector/front-end/GoToLineDialog.js: 9 (WebInspector.GoToLineDialog.install): 10 (WebInspector.GoToLineDialog._show): 11 * inspector/front-end/NetworkItemView.js: 12 (WebInspector.NetworkItemView.prototype._tabSelected): 13 (WebInspector.ResourceContentView.prototype.contentLoaded): 14 (WebInspector.ResourceContentView.prototype.canHighlightLine): 15 (WebInspector.ResourceContentView.prototype.highlightLine): 16 (set WebInspector): 17 * inspector/front-end/NetworkPanel.js: 18 (WebInspector.NetworkPanel.viewGetter): 19 (WebInspector.NetworkPanel): 20 * inspector/front-end/Panel.js: 21 (WebInspector.Panel.prototype.registerShortcut): 22 * inspector/front-end/ResourcesPanel.js: 23 (WebInspector.ResourcesPanel.viewGetter): 24 (WebInspector.ResourcesPanel): 25 (WebInspector.ResourcesPanel.prototype.showResource): 26 * inspector/front-end/ScriptsPanel.js: 27 (WebInspector.ScriptsPanel.viewGetter): 28 * inspector/front-end/SourceFrame.js: 29 (WebInspector.SourceFrame.prototype.canHighlightLine): 30 * inspector/front-end/TabbedPane.js: 31 (WebInspector.TabbedPane.prototype._hideTab): 32 (WebInspector.TabbedPane.prototype.canHighlightLine): 33 (WebInspector.TabbedPane.prototype.highlightLine): 34 * inspector/front-end/View.js: 35 (WebInspector.View.prototype.canHighlightLine): 36 (WebInspector.View.prototype.highlightLine): 37 1 38 2011-10-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 39 -
trunk/Source/WebCore/inspector/front-end/GoToLineDialog.js
r94754 r96577 67 67 } 68 68 69 WebInspector.GoToLineDialog. show = function(sourceView)69 WebInspector.GoToLineDialog.install = function(panel, viewGetter) 70 70 { 71 if (!sourceView || typeof sourceView.highlightLine !== "function") 71 function showGoToLineDialog() 72 { 73 var view = viewGetter(); 74 if (view) 75 WebInspector.GoToLineDialog._show(view); 76 } 77 78 var goToLineShortcut = WebInspector.GoToLineDialog.createShortcut(); 79 panel.registerShortcut(goToLineShortcut.key, showGoToLineDialog); 80 } 81 82 WebInspector.GoToLineDialog._show = function(sourceView) 83 { 84 if (!sourceView || !sourceView.canHighlightLine()) 72 85 return; 73 86 if (this._instance) -
trunk/Source/WebCore/inspector/front-end/NetworkItemView.js
r93196 r96577 80 80 if (event.data.isUserGesture) 81 81 WebInspector.settings.resourceViewTab.set(event.data.tabId); 82 this._installHighlightSupport(event.data.view);83 },84 85 _installHighlightSupport: function(view)86 {87 if (typeof view.highlightLine === "function")88 this.highlightLine = view.highlightLine.bind(view);89 else90 delete this.highlightLine;91 82 } 92 83 } … … 146 137 { 147 138 // Should be implemented by subclasses. 139 }, 140 141 canHighlightLine: function() 142 { 143 return this._innerView && this._innerView.canHighlightLine(); 144 }, 145 146 highlightLine: function(line) 147 { 148 if (this.canHighlightLine()) 149 this._innerView.highlightLine(line); 148 150 } 149 151 } -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r96519 r96577 1301 1301 this._viewsContainerElement.appendChild(this._closeButtonElement); 1302 1302 1303 this.registerShortcuts(); 1303 function viewGetter() 1304 { 1305 return this.visibleView; 1306 } 1307 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); 1304 1308 } 1305 1309 -
trunk/Source/WebCore/inspector/front-end/Panel.js
r93701 r96577 408 408 }, 409 409 410 registerShortcuts: function(shortcuts)411 {412 this._shortcuts = shortcuts || {};413 var goToLineShortcut = WebInspector.GoToLineDialog.createShortcut();414 this._shortcuts[goToLineShortcut.key] = this._showGoToLineDialog.bind(this);415 },416 417 410 registerShortcut: function(key, handler) 418 411 { 419 412 this._shortcuts[key] = handler; 420 },421 422 _showGoToLineDialog: function(e)423 {424 var view = this.visibleView;425 WebInspector.GoToLineDialog.show(view);426 if (view)427 WebInspector.GoToLineDialog.show(view);428 413 } 429 414 } -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r95984 r96577 76 76 this.sidebarElement.addEventListener("mouseout", this._onmouseout.bind(this), false); 77 77 78 this.registerShortcuts(); 78 function viewGetter() 79 { 80 return this.visibleView; 81 } 82 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); 79 83 80 84 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoadEventFired, this); … … 340 344 if (line !== undefined) { 341 345 var view = this._resourceViewForResource(resource); 342 if (view. highlightLine)346 if (view.canHighlightLine()) 343 347 view.highlightLine(line); 344 348 } -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r96319 r96577 33 33 this._presentationModel = presentationModel; 34 34 35 this.registerShortcuts(); 35 function viewGetter() 36 { 37 return this.visibleView; 38 } 39 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); 36 40 37 41 this.topStatusBar = document.createElement("div"); -
trunk/Source/WebCore/inspector/front-end/SourceFrame.js
r94842 r96577 162 162 { 163 163 return this._textModel; 164 }, 165 166 canHighlightLine: function(line) 167 { 168 return true; 164 169 }, 165 170 -
trunk/Source/WebCore/inspector/front-end/TabbedPane.js
r93701 r96577 84 84 tab.tabElement.removeStyleClass("selected"); 85 85 tab.view.visible = false; 86 }, 87 88 canHighlightLine: function() 89 { 90 return this._currentTab && this._currentTab.view && this._currentTab.view.canHighlightLine(); 91 }, 92 93 highlightLine: function(line) 94 { 95 if (this.canHighlightLine()) 96 this._currentTab.view.highlightLine(line); 86 97 } 87 98 } -
trunk/Source/WebCore/inspector/front-end/View.js
r96485 r96577 160 160 }, 161 161 162 canHighlightLine: function() 163 { 164 return false; 165 }, 166 167 highlightLine: function(line) 168 { 169 }, 170 162 171 doResize: function() 163 172 {
Note: See TracChangeset
for help on using the changeset viewer.