| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @implements {SDK.TargetManager.Observer} | 5 * @implements {SDK.TargetManager.Observer} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Main.ExecutionContextSelector = class { | 8 Main.ExecutionContextSelector = class { |
| 9 /** | 9 /** |
| 10 * @param {!SDK.TargetManager} targetManager | 10 * @param {!SDK.TargetManager} targetManager |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * @param {!SDK.ExecutionContext} executionContext | 124 * @param {!SDK.ExecutionContext} executionContext |
| 125 * @return {boolean} | 125 * @return {boolean} |
| 126 */ | 126 */ |
| 127 _isDefaultContext(executionContext) { | 127 _isDefaultContext(executionContext) { |
| 128 if (!executionContext.isDefault || !executionContext.frameId) | 128 if (!executionContext.isDefault || !executionContext.frameId) |
| 129 return false; | 129 return false; |
| 130 if (executionContext.target().parentTarget()) | 130 if (executionContext.target().parentTarget()) |
| 131 return false; | 131 return false; |
| 132 var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(executionContext.ta
rget()); | 132 var resourceTreeModel = executionContext.target().model(SDK.ResourceTreeMode
l); |
| 133 var frame = resourceTreeModel && resourceTreeModel.frameForId(executionConte
xt.frameId); | 133 var frame = resourceTreeModel && resourceTreeModel.frameForId(executionConte
xt.frameId); |
| 134 if (frame && frame.isMainFrame()) | 134 if (frame && frame.isMainFrame()) |
| 135 return true; | 135 return true; |
| 136 return false; | 136 return false; |
| 137 } | 137 } |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * @param {!Common.Event} event | 140 * @param {!Common.Event} event |
| 141 */ | 141 */ |
| 142 _onExecutionContextCreated(event) { | 142 _onExecutionContextCreated(event) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 newContext = executionContexts[0]; | 197 newContext = executionContexts[0]; |
| 198 break; | 198 break; |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 this._ignoreContextChanged = true; | 202 this._ignoreContextChanged = true; |
| 203 this._context.setFlavor(SDK.ExecutionContext, newContext); | 203 this._context.setFlavor(SDK.ExecutionContext, newContext); |
| 204 this._ignoreContextChanged = false; | 204 this._ignoreContextChanged = false; |
| 205 } | 205 } |
| 206 }; | 206 }; |
| OLD | NEW |