Chromium Code Reviews| 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..79365a0497e365daf0be72dec99362c43de0a7fd 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._executionContextExternallyChanged, 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 |
| + */ |
| + _executionContextExternallyChanged: function(event) |
|
vsevik
2014/06/19 07:52:42
_executionContextChangedExternally
sergeyv
2014/06/19 10:54:44
Done.
|
| + { |
| + var executionContext = /** @type {?WebInspector.ExecutionContext} */ (event.data); |
| + if (!executionContext) |
| + return; |
| + |
| + var options = this._executionContextSelector.selectElement().options; |
|
vsevik
2014/06/19 07:52:42
Please make sure we do nothing if we are notified
sergeyv
2014/06/19 10:54:44
Done.
|
| + for (var i = 0; i < options.length; ++i) { |
| + if (options[i].__executionContext === executionContext) |
| + this._executionContextSelector.select(options[i]); |
| + } |
| + }, |
| + |
| + /** |
| * @return {?WebInspector.ExecutionContext} |
| */ |
| _currentExecutionContext: function() |