| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. 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 26 matching lines...) Expand all Loading... |
| 37 target.registerLayerTreeDispatcher(new Layers.LayerTreeDispatcher(this)); | 37 target.registerLayerTreeDispatcher(new Layers.LayerTreeDispatcher(this)); |
| 38 var resourceTreeModel = target.model(SDK.ResourceTreeModel); | 38 var resourceTreeModel = target.model(SDK.ResourceTreeModel); |
| 39 if (resourceTreeModel) { | 39 if (resourceTreeModel) { |
| 40 resourceTreeModel.addEventListener( | 40 resourceTreeModel.addEventListener( |
| 41 SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavi
gated, this); | 41 SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavi
gated, this); |
| 42 } | 42 } |
| 43 /** @type {?SDK.LayerTreeBase} */ | 43 /** @type {?SDK.LayerTreeBase} */ |
| 44 this._layerTree = null; | 44 this._layerTree = null; |
| 45 } | 45 } |
| 46 | 46 |
| 47 /** | |
| 48 * @param {!SDK.Target} target | |
| 49 * @return {?Layers.LayerTreeModel} | |
| 50 */ | |
| 51 static fromTarget(target) { | |
| 52 return target.model(Layers.LayerTreeModel); | |
| 53 } | |
| 54 | |
| 55 disable() { | 47 disable() { |
| 56 if (!this._enabled) | 48 if (!this._enabled) |
| 57 return; | 49 return; |
| 58 this._enabled = false; | 50 this._enabled = false; |
| 59 this.target().layerTreeAgent().disable(); | 51 this.target().layerTreeAgent().disable(); |
| 60 } | 52 } |
| 61 | 53 |
| 62 enable() { | 54 enable() { |
| 63 if (this._enabled) | 55 if (this._enabled) |
| 64 return; | 56 return; |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 552 |
| 561 /** | 553 /** |
| 562 * @override | 554 * @override |
| 563 * @param {!Protocol.LayerTree.LayerId} layerId | 555 * @param {!Protocol.LayerTree.LayerId} layerId |
| 564 * @param {!Protocol.DOM.Rect} clipRect | 556 * @param {!Protocol.DOM.Rect} clipRect |
| 565 */ | 557 */ |
| 566 layerPainted(layerId, clipRect) { | 558 layerPainted(layerId, clipRect) { |
| 567 this._layerTreeModel._layerPainted(layerId, clipRect); | 559 this._layerTreeModel._layerPainted(layerId, clipRect); |
| 568 } | 560 } |
| 569 }; | 561 }; |
| OLD | NEW |