| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 * @param {!WebInspector.ResourcesPanel} resourcesPanel | 9 * @param {!WebInspector.ResourcesPanel} resourcesPanel |
| 10 */ | 10 */ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * @override | 65 * @override |
| 66 * @param {!WebInspector.Target} target | 66 * @param {!WebInspector.Target} target |
| 67 */ | 67 */ |
| 68 targetAdded: function(target) | 68 targetAdded: function(target) |
| 69 { | 69 { |
| 70 if (this._target) | 70 if (this._target) |
| 71 return; | 71 return; |
| 72 this._target = target; | 72 this._target = target; |
| 73 this._updateOrigin(target.resourceTreeModel.mainFrame ? target.resourceT
reeModel.mainFrame.url : ""); | 73 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target
); |
| 74 this._updateOrigin((resourceTreeModel && resourceTreeModel.mainFrame) ?
resourceTreeModel.mainFrame.url : ""); |
| 74 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E
vents.MainFrameNavigated, this._updateFrame, this); | 75 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E
vents.MainFrameNavigated, this._updateFrame, this); |
| 75 }, | 76 }, |
| 76 | 77 |
| 77 /** | 78 /** |
| 78 * @param {!WebInspector.Event} event | 79 * @param {!WebInspector.Event} event |
| 79 */ | 80 */ |
| 80 _updateFrame: function(event) | 81 _updateFrame: function(event) |
| 81 { | 82 { |
| 82 var frame = /** *@type {!WebInspector.ResourceTreeFrame} */ (event.data)
; | 83 var frame = /** *@type {!WebInspector.ResourceTreeFrame} */ (event.data)
; |
| 83 this._updateOrigin(frame.url); | 84 this._updateOrigin(frame.url); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 /** | 156 /** |
| 156 * @override | 157 * @override |
| 157 * @param {!WebInspector.Target} target | 158 * @param {!WebInspector.Target} target |
| 158 */ | 159 */ |
| 159 targetRemoved: function(target) | 160 targetRemoved: function(target) |
| 160 { | 161 { |
| 161 }, | 162 }, |
| 162 | 163 |
| 163 __proto__: WebInspector.VBox.prototype | 164 __proto__: WebInspector.VBox.prototype |
| 164 } | 165 } |
| OLD | NEW |