OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) IBM Corp. 2009 All rights reserved. | 2 * Copyright (C) IBM Corp. 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 refreshButton.title = WebInspector.UIString("Refresh"); | 45 refreshButton.title = WebInspector.UIString("Refresh"); |
46 this.titleElement.appendChild(refreshButton); | 46 this.titleElement.appendChild(refreshButton); |
47 | 47 |
48 var addButton = document.createElement("button"); | 48 var addButton = document.createElement("button"); |
49 addButton.className = "pane-title-button add"; | 49 addButton.className = "pane-title-button add"; |
50 addButton.addEventListener("click", this._addButtonClicked.bind(this), false
); | 50 addButton.addEventListener("click", this._addButtonClicked.bind(this), false
); |
51 this.titleElement.appendChild(addButton); | 51 this.titleElement.appendChild(addButton); |
52 addButton.title = WebInspector.UIString("Add watch expression"); | 52 addButton.title = WebInspector.UIString("Add watch expression"); |
53 | 53 |
54 this._requiresUpdate = true; | 54 this._requiresUpdate = true; |
| 55 WebInspector.executionContextSelector.addExecutionContextChangeListener(this
.refreshExpressions, this); |
55 } | 56 } |
56 | 57 |
57 WebInspector.WatchExpressionsSidebarPane.prototype = { | 58 WebInspector.WatchExpressionsSidebarPane.prototype = { |
58 wasShown: function() | 59 wasShown: function() |
59 { | 60 { |
60 this._refreshExpressionsIfNeeded(); | 61 this._refreshExpressionsIfNeeded(); |
61 }, | 62 }, |
62 | 63 |
63 reset: function() | |
64 { | |
65 this.refreshExpressions(); | |
66 }, | |
67 | |
68 refreshExpressions: function() | 64 refreshExpressions: function() |
69 { | 65 { |
70 this._requiresUpdate = true; | 66 this._requiresUpdate = true; |
71 this._refreshExpressionsIfNeeded(); | 67 this._refreshExpressionsIfNeeded(); |
72 }, | 68 }, |
73 | 69 |
74 addExpression: function(expression) | 70 addExpression: function(expression) |
75 { | 71 { |
76 this.section.addExpression(expression); | 72 this.section.addExpression(expression); |
77 this.expand(); | 73 this.expand(); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // in appendResult() | 192 // in appendResult() |
197 var propertyCount = 0; | 193 var propertyCount = 0; |
198 for (var i = 0; i < this.watchExpressions.length; ++i) { | 194 for (var i = 0; i < this.watchExpressions.length; ++i) { |
199 if (!this.watchExpressions[i]) | 195 if (!this.watchExpressions[i]) |
200 continue; | 196 continue; |
201 ++propertyCount; | 197 ++propertyCount; |
202 } | 198 } |
203 | 199 |
204 // Now process all the expressions, since we have the actual count, | 200 // Now process all the expressions, since we have the actual count, |
205 // which is checked in the appendResult inner function. | 201 // which is checked in the appendResult inner function. |
206 var currentExecutionContext = WebInspector.context.flavor(WebInspector.E
xecutionContext); | 202 var currentExecutionContext = WebInspector.executionContextSelector.curr
entExecutionContext(); |
207 if (currentExecutionContext) { | 203 if (currentExecutionContext) { |
208 for (var i = 0; i < this.watchExpressions.length; ++i) { | 204 for (var i = 0; i < this.watchExpressions.length; ++i) { |
209 var expression = this.watchExpressions[i]; | 205 var expression = this.watchExpressions[i]; |
210 if (!expression) | 206 if (!expression) |
211 continue; | 207 continue; |
212 | 208 |
213 currentExecutionContext.evaluate(expression, this._watchObjectGr
oupId, false, true, false, false, appendResult.bind(this, expression, i)); | 209 currentExecutionContext.evaluate(expression, this._watchObjectGr
oupId, false, true, false, false, appendResult.bind(this, expression, i)); |
214 } | 210 } |
215 } | 211 } |
216 | 212 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 }, | 504 }, |
509 | 505 |
510 oncollapse: function() | 506 oncollapse: function() |
511 { | 507 { |
512 WebInspector.ObjectPropertyTreeElement.prototype.oncollapse.call(this); | 508 WebInspector.ObjectPropertyTreeElement.prototype.oncollapse.call(this); |
513 delete this.treeOutline.section._expandedProperties[this.propertyPath()]
; | 509 delete this.treeOutline.section._expandedProperties[this.propertyPath()]
; |
514 }, | 510 }, |
515 | 511 |
516 __proto__: WebInspector.ObjectPropertyTreeElement.prototype | 512 __proto__: WebInspector.ObjectPropertyTreeElement.prototype |
517 } | 513 } |
OLD | NEW |