Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Unified Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 338283004: DevTools: Use TargetsToolbar instead of ThreadToolbar (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address vsevik's comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()
« no previous file with comments | « Source/devtools/front_end/components/ExecutionContextSelector.js ('k') | Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698