| Index: Source/devtools/front_end/console/ConsoleView.js
|
| diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
|
| index 07c97e5f2c469962c35304b32a526238bf4722dd..8b125cbff0b42fb124c3fff350911fc15f812e6b 100644
|
| --- a/Source/devtools/front_end/console/ConsoleView.js
|
| +++ b/Source/devtools/front_end/console/ConsoleView.js
|
| @@ -140,6 +140,7 @@ WebInspector.ConsoleView = function(hideContextSelector)
|
|
|
| this._registerWithMessageSink();
|
| WebInspector.targetManager.observeTargets(this);
|
| + WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChangedExternally, this);
|
| }
|
|
|
| WebInspector.ConsoleView.prototype = {
|
| @@ -318,6 +319,8 @@ WebInspector.ConsoleView.prototype = {
|
| }
|
| }
|
| this._executionContextSelector.selectElement().insertBefore(newOption, insertBeforeOption);
|
| + if (executionContext === WebInspector.context.flavor(WebInspector.ExecutionContext))
|
| + this._executionContextSelector.select(newOption);
|
| },
|
|
|
| /**
|
| @@ -340,6 +343,22 @@ WebInspector.ConsoleView.prototype = {
|
| },
|
|
|
| /**
|
| + * @param {!WebInspector.Event} event
|
| + */
|
| + _executionContextChangedExternally: function(event)
|
| + {
|
| + var executionContext = /** @type {?WebInspector.ExecutionContext} */ (event.data);
|
| + if (!executionContext)
|
| + return;
|
| +
|
| + var options = this._executionContextSelector.selectElement().options;
|
| + for (var i = 0; i < options.length; ++i) {
|
| + if (options[i].__executionContext === executionContext)
|
| + this._executionContextSelector.select(options[i]);
|
| + }
|
| + },
|
| +
|
| + /**
|
| * @return {?WebInspector.ExecutionContext}
|
| */
|
| _currentExecutionContext: function()
|
|
|