| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * @param {?string} expression | 112 * @param {?string} expression |
| 113 * @return {!Sources.WatchExpression} | 113 * @return {!Sources.WatchExpression} |
| 114 */ | 114 */ |
| 115 _createWatchExpression(expression) { | 115 _createWatchExpression(expression) { |
| 116 this._emptyElement.classList.add('hidden'); | 116 this._emptyElement.classList.add('hidden'); |
| 117 var watchExpression = new Sources.WatchExpression(expression, this._expandCo
ntroller, this._linkifier); | 117 var watchExpression = new Sources.WatchExpression(expression, this._expandCo
ntroller, this._linkifier); |
| 118 watchExpression.addEventListener( | 118 watchExpression.addEventListener( |
| 119 Sources.WatchExpression.Events.ExpressionUpdated, this._watchExpressionU
pdated.bind(this)); | 119 Sources.WatchExpression.Events.ExpressionUpdated, this._watchExpressionU
pdated, this); |
| 120 this._bodyElement.appendChild(watchExpression.element()); | 120 this._bodyElement.appendChild(watchExpression.element()); |
| 121 this._watchExpressions.push(watchExpression); | 121 this._watchExpressions.push(watchExpression); |
| 122 return watchExpression; | 122 return watchExpression; |
| 123 } | 123 } |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * @param {!Common.Event} event | 126 * @param {!Common.Event} event |
| 127 */ | 127 */ |
| 128 _watchExpressionUpdated(event) { | 128 _watchExpressionUpdated(event) { |
| 129 var watchExpression = /** @type {!Sources.WatchExpression} */ (event.target)
; | 129 var watchExpression = /** @type {!Sources.WatchExpression} */ (event.data); |
| 130 if (!watchExpression.expression()) { | 130 if (!watchExpression.expression()) { |
| 131 this._watchExpressions.remove(watchExpression); | 131 this._watchExpressions.remove(watchExpression); |
| 132 this._bodyElement.removeChild(watchExpression.element()); | 132 this._bodyElement.removeChild(watchExpression.element()); |
| 133 this._emptyElement.classList.toggle('hidden', !!this._watchExpressions.len
gth); | 133 this._emptyElement.classList.toggle('hidden', !!this._watchExpressions.len
gth); |
| 134 } | 134 } |
| 135 | 135 |
| 136 this._saveExpressions(); | 136 this._saveExpressions(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 /** | 139 /** |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 297 } |
| 298 | 298 |
| 299 /** | 299 /** |
| 300 * @param {?string} newExpression | 300 * @param {?string} newExpression |
| 301 */ | 301 */ |
| 302 _updateExpression(newExpression) { | 302 _updateExpression(newExpression) { |
| 303 if (this._expression) | 303 if (this._expression) |
| 304 this._expandController.stopWatchSectionsWithId(this._expression); | 304 this._expandController.stopWatchSectionsWithId(this._expression); |
| 305 this._expression = newExpression; | 305 this._expression = newExpression; |
| 306 this.update(); | 306 this.update(); |
| 307 this.dispatchEventToListeners(Sources.WatchExpression.Events.ExpressionUpdat
ed); | 307 this.dispatchEventToListeners(Sources.WatchExpression.Events.ExpressionUpdat
ed, this); |
| 308 } | 308 } |
| 309 | 309 |
| 310 /** | 310 /** |
| 311 * @param {!Event} event | 311 * @param {!Event} event |
| 312 */ | 312 */ |
| 313 _deleteWatchExpression(event) { | 313 _deleteWatchExpression(event) { |
| 314 event.consume(true); | 314 event.consume(true); |
| 315 this._updateExpression(null); | 315 this._updateExpression(null); |
| 316 } | 316 } |
| 317 | 317 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 InspectorFrontendHost.copyText(this._valueElement.textContent); | 417 InspectorFrontendHost.copyText(this._valueElement.textContent); |
| 418 } | 418 } |
| 419 }; | 419 }; |
| 420 | 420 |
| 421 Sources.WatchExpression._watchObjectGroupId = 'watch-group'; | 421 Sources.WatchExpression._watchObjectGroupId = 'watch-group'; |
| 422 | 422 |
| 423 /** @enum {symbol} */ | 423 /** @enum {symbol} */ |
| 424 Sources.WatchExpression.Events = { | 424 Sources.WatchExpression.Events = { |
| 425 ExpressionUpdated: Symbol('ExpressionUpdated') | 425 ExpressionUpdated: Symbol('ExpressionUpdated') |
| 426 }; | 426 }; |
| OLD | NEW |