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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2254683003: DevTools: setting to auto-reveal in navigator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dont open navigator at all un Created 4 years, 4 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 | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
},
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698