| 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..e79325f04c432999ec998c5dfa7768851289f816 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/Runtime.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js
|
| @@ -455,6 +455,16 @@
|
| Runtime._originalAssert.call(Runtime._console, value, message + " " + new Error().stack);
|
| }
|
|
|
| +Runtime._platform = "";
|
| +
|
| +/**
|
| + * @param {string} platform
|
| + */
|
| +Runtime.setPlatform = function(platform)
|
| +{
|
| + Runtime._platform = platform;
|
| +}
|
| +
|
| Runtime.prototype = {
|
| useTestBase: function()
|
| {
|
| @@ -563,11 +573,12 @@
|
| /**
|
| * @param {*} type
|
| * @param {?Object=} context
|
| + * @param {boolean=} sortByTitle
|
| * @return {!Array.<!Runtime.Extension>}
|
| */
|
| - extensions: function(type, context)
|
| - {
|
| - return this._extensions.filter(filter).sort(orderComparator);
|
| + extensions: function(type, context, sortByTitle)
|
| + {
|
| + return this._extensions.filter(filter).sort(sortByTitle ? titleComparator : orderComparator);
|
|
|
| /**
|
| * @param {!Runtime.Extension} extension
|
| @@ -593,6 +604,18 @@
|
| 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.title() || "";
|
| + var title2 = extension2.title() || "";
|
| + return title1.localeCompare(title2);
|
| + }
|
| },
|
|
|
| /**
|
| @@ -978,13 +1001,12 @@
|
| },
|
|
|
| /**
|
| - * @param {string} platform
|
| * @return {string}
|
| */
|
| - title: function(platform)
|
| + title: function()
|
| {
|
| // FIXME: should be WebInspector.UIString() but runtime is not l10n aware yet.
|
| - return this._descriptor["title-" + platform] || this._descriptor["title"];
|
| + return this._descriptor["title-" + Runtime._platform] || this._descriptor["title"];
|
| }
|
| }
|
|
|
|
|