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

Unified Diff: third_party/WebKit/Source/devtools/front_end/Runtime.js

Issue 2137763002: DevTools: automatically populate 'More tools' submenu with the drawer views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/Runtime.js
diff --git a/third_party/WebKit/Source/devtools/front_end/Runtime.js b/third_party/WebKit/Source/devtools/front_end/Runtime.js
index a1e681fb335bb6848dcae97e927f64116c6244a3..bfa0aa1f1f40ca246c06cb25da592e5d0e4a9cfb 100644
--- a/third_party/WebKit/Source/devtools/front_end/Runtime.js
+++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js
@@ -563,11 +563,12 @@ Runtime.prototype = {
/**
* @param {*} type
* @param {?Object=} context
+ * @param {boolean=} sortByTitle
* @return {!Array.<!Runtime.Extension>}
*/
- extensions: function(type, context)
+ extensions: function(type, context, sortByTitle)
{
- return this._extensions.filter(filter).sort(orderComparator);
+ return this._extensions.filter(filter).sort(sortByTitle ? titleComparator : orderComparator);
/**
* @param {!Runtime.Extension} extension
@@ -593,6 +594,18 @@ Runtime.prototype = {
var order2 = extension2.descriptor()["order"] || 0;
return order1 - order2;
}
+
+ /**
+ * @param {!Runtime.Extension} extension1
+ * @param {!Runtime.Extension} extension2
+ * @return {number}
+ */
+ function titleComparator(extension1, extension2)
+ {
+ var title1 = extension1.descriptor()["title"] || "";
dgozman 2016/07/09 01:12:15 We have title(platform) function. Let's pass platf
pfeldman 2016/07/09 01:37:03 I actually don't like it even in title. Seems like
+ var title2 = extension2.descriptor()["title"] || "";
+ return title1.localeCompare(title2);
+ }
},
/**

Powered by Google App Engine
This is Rietveld 408576698