Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
index 5348993f0784b4615bccb078b009b0bf6cb0aa1f..d499eed34920a2ca86933869040c4c05f1e45993 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js |
@@ -355,22 +355,28 @@ WebInspector.SourcesPanel.prototype = { |
/** |
* @param {!WebInspector.UISourceCode} uiSourceCode |
+ * @param {boolean=} skipReveal |
*/ |
- _revealInNavigator: function(uiSourceCode) |
+ _revealInNavigator: function(uiSourceCode, skipReveal) |
{ |
var extensions = self.runtime.extensions(WebInspector.NavigatorView); |
- Promise.all(extensions.map(extension => extension.instance())).then(filterNavigators); |
+ Promise.all(extensions.map(extension => extension.instance())).then(filterNavigators.bind(this)); |
/** |
+ * @this {WebInspector.SourcesPanel} |
* @param {!Array.<!Object>} objects |
*/ |
function filterNavigators(objects) |
{ |
for (var i = 0; i < objects.length; ++i) { |
var navigatorView = /** @type {!WebInspector.NavigatorView} */ (objects[i]); |
+ var viewId = extensions[i].descriptor()["viewId"]; |
if (navigatorView.accept(uiSourceCode)) { |
navigatorView.revealUISourceCode(uiSourceCode, true); |
- WebInspector.viewManager.showView(extensions[i].descriptor()["viewId"]); |
+ if (skipReveal) |
lushnikov
2016/08/26 23:23:52
I guess @pfeldman meant that we should shortcut on
|
+ this._navigatorTabbedLocation.tabbedPane().selectTab(viewId); |
+ else |
+ WebInspector.viewManager.showView(viewId); |
} |
} |
} |
@@ -527,6 +533,8 @@ WebInspector.SourcesPanel.prototype = { |
{ |
var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); |
this._editorChanged(uiSourceCode); |
+ if (this.editorView.mainWidget() && WebInspector.moduleSetting("autoRevealInNavigator").get()) |
+ this._revealInNavigator(uiSourceCode, true); |
}, |
/** |