| Index: Source/devtools/front_end/components/ExecutionContextModel.js
|
| diff --git a/Source/devtools/front_end/components/ExecutionContextModel.js b/Source/devtools/front_end/components/ExecutionContextModel.js
|
| index e417de90149a4f85ce96827554177c4c8580a966..95a55893fff06e4d96957ca16999fc01025d86f6 100644
|
| --- a/Source/devtools/front_end/components/ExecutionContextModel.js
|
| +++ b/Source/devtools/front_end/components/ExecutionContextModel.js
|
| @@ -18,6 +18,7 @@ WebInspector.ExecutionContextModel = function(selectElement)
|
| WebInspector.targetManager.observeTargets(this);
|
| WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCreated, this);
|
| WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextDestroyed, this);
|
| + WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._onFrameNavigated, this);
|
|
|
| this._selectElement.addEventListener("change", this._executionContextChanged.bind(this), false);
|
| WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChangedExternally, this);
|
| @@ -110,6 +111,20 @@ WebInspector.ExecutionContextModel.prototype = {
|
| /**
|
| * @param {!WebInspector.Event} event
|
| */
|
| + _onFrameNavigated: function(event)
|
| + {
|
| + var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data);
|
| + var executionContexts = this._optionByExecutionContext.keysArray();
|
| + for (var i = 0; i < executionContexts.length; ++i) {
|
| + var context = executionContexts[i];
|
| + if (context.frameId === frame.id)
|
| + this._optionByExecutionContext.get(context).text = this._titleFor(context);
|
| + }
|
| + },
|
| +
|
| + /**
|
| + * @param {!WebInspector.Event} event
|
| + */
|
| _executionContextChangedExternally: function(event)
|
| {
|
| var executionContext = /** @type {?WebInspector.ExecutionContext} */ (event.data);
|
|
|