| 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 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 this.panel.updateStyles(true); | 56 this.panel.updateStyles(true); |
| 57 this.panel.updateMetrics(); | 57 this.panel.updateMetrics(); |
| 58 this.panel.updateProperties(); | 58 this.panel.updateProperties(); |
| 59 this.panel.updateEventListeners(); | 59 this.panel.updateEventListeners(); |
| 60 | 60 |
| 61 if (InspectorBackend.searchingForNode()) { | 61 if (InspectorBackend.searchingForNode()) { |
| 62 InspectorBackend.toggleNodeSearch(); | 62 InspectorBackend.toggleNodeSearch(); |
| 63 this.panel.nodeSearchButton.toggled = false; | 63 this.panel.nodeSearchButton.toggled = false; |
| 64 } | 64 } |
| 65 if (this._focusedDOMNode) | 65 if (this._focusedDOMNode) |
| 66 InjectedScriptAccess.addInspectedNode(this._focusedDOMNode.id, funct
ion() {}); | 66 InjectedScriptAccess.get(this._focusedDOMNode.injectedScriptId).addI
nspectedNode(this._focusedDOMNode.id, function() {}); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 this.contentElement.appendChild(this.treeOutline.element); | 69 this.contentElement.appendChild(this.treeOutline.element); |
| 70 | 70 |
| 71 this.crumbsElement = document.createElement("div"); | 71 this.crumbsElement = document.createElement("div"); |
| 72 this.crumbsElement.className = "crumbs"; | 72 this.crumbsElement.className = "crumbs"; |
| 73 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi
nd(this), false); | 73 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi
nd(this), false); |
| 74 this.crumbsElement.addEventListener("mouseout", this._mouseMovedOutOfCrumbs.
bind(this), false); | 74 this.crumbsElement.addEventListener("mouseout", this._mouseMovedOutOfCrumbs.
bind(this), false); |
| 75 | 75 |
| 76 this.sidebarPanes = {}; | 76 this.sidebarPanes = {}; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 { | 229 { |
| 230 if (this.focusedDOMNode) { | 230 if (this.focusedDOMNode) { |
| 231 // Focused node has been explicitly set while reaching out for t
he last selected node. | 231 // Focused node has been explicitly set while reaching out for t
he last selected node. |
| 232 return; | 232 return; |
| 233 } | 233 } |
| 234 var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : 0; | 234 var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : 0; |
| 235 selectNode.call(this, node); | 235 selectNode.call(this, node); |
| 236 } | 236 } |
| 237 | 237 |
| 238 if (this._selectedPathOnReset) | 238 if (this._selectedPathOnReset) |
| 239 InjectedScriptAccess.nodeByPath(this._selectedPathOnReset, selectLas
tSelectedNode.bind(this)); | 239 InjectedScriptAccess.getDefault().nodeByPath(this._selectedPathOnRes
et, selectLastSelectedNode.bind(this)); |
| 240 else | 240 else |
| 241 selectNode.call(this); | 241 selectNode.call(this); |
| 242 delete this._selectedPathOnReset; | 242 delete this._selectedPathOnReset; |
| 243 }, | 243 }, |
| 244 | 244 |
| 245 searchCanceled: function() | 245 searchCanceled: function() |
| 246 { | 246 { |
| 247 if (this._searchResults) { | 247 if (this._searchResults) { |
| 248 for (var i = 0; i < this._searchResults.length; ++i) { | 248 for (var i = 0; i < this._searchResults.length; ++i) { |
| 249 var treeElement = this.treeOutline.findTreeElement(this._searchR
esults[i]); | 249 var treeElement = this.treeOutline.findTreeElement(this._searchR
esults[i]); |
| 250 if (treeElement) | 250 if (treeElement) |
| 251 treeElement.highlighted = false; | 251 treeElement.highlighted = false; |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 | 254 |
| 255 WebInspector.updateSearchMatchesCount(0, this); | 255 WebInspector.updateSearchMatchesCount(0, this); |
| 256 | 256 |
| 257 this._currentSearchResultIndex = 0; | 257 this._currentSearchResultIndex = 0; |
| 258 this._searchResults = []; | 258 this._searchResults = []; |
| 259 InjectedScriptAccess.searchCanceled(function() {}); | 259 InjectedScriptAccess.getDefault().searchCanceled(function() {}); |
| 260 }, | 260 }, |
| 261 | 261 |
| 262 performSearch: function(query) | 262 performSearch: function(query) |
| 263 { | 263 { |
| 264 // Call searchCanceled since it will reset everything we need before doi
ng a new search. | 264 // Call searchCanceled since it will reset everything we need before doi
ng a new search. |
| 265 this.searchCanceled(); | 265 this.searchCanceled(); |
| 266 | 266 |
| 267 const whitespaceTrimmedQuery = query.trimWhitespace(); | 267 const whitespaceTrimmedQuery = query.trimWhitespace(); |
| 268 if (!whitespaceTrimmedQuery.length) | 268 if (!whitespaceTrimmedQuery.length) |
| 269 return; | 269 return; |
| 270 | 270 |
| 271 this._updatedMatchCountOnce = false; | 271 this._updatedMatchCountOnce = false; |
| 272 this._matchesCountUpdateTimeout = null; | 272 this._matchesCountUpdateTimeout = null; |
| 273 | 273 |
| 274 InjectedScriptAccess.performSearch(whitespaceTrimmedQuery, function() {}
); | 274 InjectedScriptAccess.getDefault().performSearch(whitespaceTrimmedQuery,
function() {}); |
| 275 }, | 275 }, |
| 276 | 276 |
| 277 _updateMatchesCount: function() | 277 _updateMatchesCount: function() |
| 278 { | 278 { |
| 279 WebInspector.updateSearchMatchesCount(this._searchResults.length, this); | 279 WebInspector.updateSearchMatchesCount(this._searchResults.length, this); |
| 280 this._matchesCountUpdateTimeout = null; | 280 this._matchesCountUpdateTimeout = null; |
| 281 this._updatedMatchCountOnce = true; | 281 this._updatedMatchCountOnce = true; |
| 282 }, | 282 }, |
| 283 | 283 |
| 284 _updateMatchesCountSoon: function() | 284 _updateMatchesCountSoon: function() |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 | 1087 |
| 1088 _nodeSearchButtonClicked: function(event) | 1088 _nodeSearchButtonClicked: function(event) |
| 1089 { | 1089 { |
| 1090 InspectorBackend.toggleNodeSearch(); | 1090 InspectorBackend.toggleNodeSearch(); |
| 1091 | 1091 |
| 1092 this.nodeSearchButton.toggled = InspectorBackend.searchingForNode(); | 1092 this.nodeSearchButton.toggled = InspectorBackend.searchingForNode(); |
| 1093 } | 1093 } |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 WebInspector.ElementsPanel.prototype.__proto__ = WebInspector.Panel.prototype; | 1096 WebInspector.ElementsPanel.prototype.__proto__ = WebInspector.Panel.prototype; |
| OLD | NEW |