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

Unified Diff: Source/devtools/front_end/components/ExecutionContextModel.js

Issue 1165393003: [DevTools] Update execution context title in select on frame navigation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698