Chromium Code Reviews| 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); |
| + } |
| }, |
| /** |