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

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

Issue 2205123003: DevTools: introduce view locations, allow opening views by id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed 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
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 4a26bf8319569a9a23def6c3e9ef501b5bec473c..33d4954150a9f2f7c29362168de3ce53166919cb 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -29,6 +29,7 @@
* @extends {WebInspector.Panel}
* @implements {WebInspector.ContextMenu.Provider}
* @implements {WebInspector.TargetManager.Observer}
+ * @implements {WebInspector.ViewLocationResolver}
*/
WebInspector.SourcesPanel = function()
{
@@ -214,6 +215,17 @@ WebInspector.SourcesPanel.prototype = {
},
/**
+ * @override
+ * @param {string} locationName
+ * @return {?WebInspector.ViewLocation}
+ */
+ resolveLocation: function(locationName)
+ {
+ WebInspector.inspectorView.setCurrentPanel(WebInspector.SourcesPanel.instance());
+ return this._navigatorTabbedPane;
+ },
+
+ /**
* @return {boolean}
*/
_ensureSourcesViewVisible: function()
@@ -405,7 +417,7 @@ WebInspector.SourcesPanel.prototype = {
*/
_revealInNavigator: function(uiSourceCode)
{
- var extensions = self.runtime.extensions("view").filter(extension => extension.descriptor()["location"] === "navigator-view");
+ var extensions = self.runtime.extensions(WebInspector.NavigatorView);
Promise.all(extensions.map(extension => extension.instance())).then(filterNavigators);
/**
@@ -416,8 +428,8 @@ WebInspector.SourcesPanel.prototype = {
for (var i = 0; i < objects.length; ++i) {
var navigatorView = /** @type {!WebInspector.NavigatorView} */ (objects[i]);
if (navigatorView.accept(uiSourceCode)) {
- navigatorView.revealWidget();
navigatorView.revealUISourceCode(uiSourceCode, true);
+ WebInspector.viewManager.showView(extensions[i].descriptor()["viewId"]);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698