| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 addButton.addEventListener("click", this._addButtonClicked.bind(this)); | 46 addButton.addEventListener("click", this._addButtonClicked.bind(this)); |
| 47 this.addToolbarItem(addButton); | 47 this.addToolbarItem(addButton); |
| 48 var refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("Re
fresh"), "refresh-toolbar-item"); | 48 var refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("Re
fresh"), "refresh-toolbar-item"); |
| 49 refreshButton.addEventListener("click", this._refreshButtonClicked.bind(this
)); | 49 refreshButton.addEventListener("click", this._refreshButtonClicked.bind(this
)); |
| 50 this.addToolbarItem(refreshButton); | 50 this.addToolbarItem(refreshButton); |
| 51 | 51 |
| 52 this._bodyElement = this.element.createChild("div", "vbox watch-expressions"
); | 52 this._bodyElement = this.element.createChild("div", "vbox watch-expressions"
); |
| 53 this._bodyElement.addEventListener("contextmenu", this._contextMenu.bind(thi
s), false); | 53 this._bodyElement.addEventListener("contextmenu", this._contextMenu.bind(thi
s), false); |
| 54 this._expandController = new WebInspector.ObjectPropertiesSectionExpandContr
oller(); | 54 this._expandController = new WebInspector.ObjectPropertiesSectionExpandContr
oller(); |
| 55 | 55 |
| 56 WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext,
this.refreshExpressions, this); | 56 WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext,
this._refreshExpressions, this); |
| 57 | 57 WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.Call
Frame, this._refreshExpressions, this); |
| 58 this._linkifier = new WebInspector.Linkifier(); | 58 this._linkifier = new WebInspector.Linkifier(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 WebInspector.WatchExpressionsSidebarPane.prototype = { | 61 WebInspector.WatchExpressionsSidebarPane.prototype = { |
| 62 wasShown: function() | 62 wasShown: function() |
| 63 { | 63 { |
| 64 this._refreshExpressionsIfNeeded(); | 64 this._refreshExpressionsIfNeeded(); |
| 65 }, | 65 }, |
| 66 | 66 |
| 67 refreshExpressions: function() | 67 _refreshExpressions: function() |
| 68 { | 68 { |
| 69 this._requiresUpdate = true; | 69 this._requiresUpdate = true; |
| 70 this._refreshExpressionsIfNeeded(); | 70 this._refreshExpressionsIfNeeded(); |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * @param {string} expressionString | 74 * @param {string} expressionString |
| 75 */ | 75 */ |
| 76 addExpression: function(expressionString) | 76 addExpression: function(expressionString) |
| 77 { | 77 { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 this.revealView(); | 121 this.revealView(); |
| 122 this._createWatchExpression(null).startEditing(); | 122 this._createWatchExpression(null).startEditing(); |
| 123 }, | 123 }, |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * @param {!WebInspector.Event} event | 126 * @param {!WebInspector.Event} event |
| 127 */ | 127 */ |
| 128 _refreshButtonClicked: function(event) | 128 _refreshButtonClicked: function(event) |
| 129 { | 129 { |
| 130 event.consume(); | 130 event.consume(); |
| 131 this.refreshExpressions(); | 131 this._refreshExpressions(); |
| 132 }, | 132 }, |
| 133 | 133 |
| 134 _rebuildWatchExpressions: function() | 134 _rebuildWatchExpressions: function() |
| 135 { | 135 { |
| 136 this._linkifier.reset(); | 136 this._linkifier.reset(); |
| 137 this._bodyElement.removeChildren(); | 137 this._bodyElement.removeChildren(); |
| 138 this._watchExpressions = []; | 138 this._watchExpressions = []; |
| 139 this._emptyElement = this._bodyElement.createChild("div", "gray-info-mes
sage"); | 139 this._emptyElement = this._bodyElement.createChild("div", "gray-info-mes
sage"); |
| 140 this._emptyElement.textContent = WebInspector.UIString("No Watch Express
ions"); | 140 this._emptyElement.textContent = WebInspector.UIString("No Watch Express
ions"); |
| 141 var watchExpressionStrings = this._watchExpressionsSetting.get(); | 141 var watchExpressionStrings = this._watchExpressionsSetting.get(); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 contextMenu.appendApplicableItems(this._result); | 438 contextMenu.appendApplicableItems(this._result); |
| 439 }, | 439 }, |
| 440 | 440 |
| 441 _copyValueButtonClicked: function() | 441 _copyValueButtonClicked: function() |
| 442 { | 442 { |
| 443 InspectorFrontendHost.copyText(this._valueElement.textContent); | 443 InspectorFrontendHost.copyText(this._valueElement.textContent); |
| 444 }, | 444 }, |
| 445 | 445 |
| 446 __proto__: WebInspector.Object.prototype | 446 __proto__: WebInspector.Object.prototype |
| 447 } | 447 } |
| OLD | NEW |