| Index: third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js b/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js
|
| index b2d36bfa9771be9ffe87d2f8395876bfe151ef74..e3fcce8eea9c3dd98e79d267a97a6d875279cc3c 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js
|
| @@ -27,98 +27,88 @@
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
| -
|
| /**
|
| - * @constructor
|
| * @implements {WebInspector.Progress}
|
| + * @unrestricted
|
| */
|
| -WebInspector.ProgressIndicator = function()
|
| -{
|
| - this.element = createElementWithClass("div", "progress-indicator");
|
| - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, "ui/progressIndicator.css");
|
| - this._contentElement = this._shadowRoot.createChild("div", "progress-indicator-shadow-container");
|
| +WebInspector.ProgressIndicator = class {
|
| + constructor() {
|
| + this.element = createElementWithClass('div', 'progress-indicator');
|
| + this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/progressIndicator.css');
|
| + this._contentElement = this._shadowRoot.createChild('div', 'progress-indicator-shadow-container');
|
|
|
| - this._labelElement = this._contentElement.createChild("div", "title");
|
| - this._progressElement = this._contentElement.createChild("progress");
|
| + this._labelElement = this._contentElement.createChild('div', 'title');
|
| + this._progressElement = this._contentElement.createChild('progress');
|
| this._progressElement.value = 0;
|
| - this._stopButton = this._contentElement.createChild("button", "progress-indicator-shadow-stop-button");
|
| - this._stopButton.addEventListener("click", this.cancel.bind(this));
|
| + this._stopButton = this._contentElement.createChild('button', 'progress-indicator-shadow-stop-button');
|
| + this._stopButton.addEventListener('click', this.cancel.bind(this));
|
|
|
| this._isCanceled = false;
|
| this._worked = 0;
|
| -};
|
| + }
|
|
|
| -WebInspector.ProgressIndicator.prototype = {
|
| - /**
|
| - * @param {!Element} parent
|
| - */
|
| - show: function(parent)
|
| - {
|
| - parent.appendChild(this.element);
|
| - },
|
| + /**
|
| + * @param {!Element} parent
|
| + */
|
| + show(parent) {
|
| + parent.appendChild(this.element);
|
| + }
|
|
|
| - /**
|
| - * @override
|
| - */
|
| - done: function()
|
| - {
|
| - if (this._isDone)
|
| - return;
|
| - this._isDone = true;
|
| - this.element.remove();
|
| - },
|
| + /**
|
| + * @override
|
| + */
|
| + done() {
|
| + if (this._isDone)
|
| + return;
|
| + this._isDone = true;
|
| + this.element.remove();
|
| + }
|
|
|
| - cancel: function()
|
| - {
|
| - this._isCanceled = true;
|
| - },
|
| + cancel() {
|
| + this._isCanceled = true;
|
| + }
|
|
|
| - /**
|
| - * @override
|
| - * @return {boolean}
|
| - */
|
| - isCanceled: function()
|
| - {
|
| - return this._isCanceled;
|
| - },
|
| + /**
|
| + * @override
|
| + * @return {boolean}
|
| + */
|
| + isCanceled() {
|
| + return this._isCanceled;
|
| + }
|
|
|
| - /**
|
| - * @override
|
| - * @param {string} title
|
| - */
|
| - setTitle: function(title)
|
| - {
|
| - this._labelElement.textContent = title;
|
| - },
|
| + /**
|
| + * @override
|
| + * @param {string} title
|
| + */
|
| + setTitle(title) {
|
| + this._labelElement.textContent = title;
|
| + }
|
|
|
| - /**
|
| - * @override
|
| - * @param {number} totalWork
|
| - */
|
| - setTotalWork: function(totalWork)
|
| - {
|
| - this._progressElement.max = totalWork;
|
| - },
|
| + /**
|
| + * @override
|
| + * @param {number} totalWork
|
| + */
|
| + setTotalWork(totalWork) {
|
| + this._progressElement.max = totalWork;
|
| + }
|
|
|
| - /**
|
| - * @override
|
| - * @param {number} worked
|
| - * @param {string=} title
|
| - */
|
| - setWorked: function(worked, title)
|
| - {
|
| - this._worked = worked;
|
| - this._progressElement.value = worked;
|
| - if (title)
|
| - this.setTitle(title);
|
| - },
|
| + /**
|
| + * @override
|
| + * @param {number} worked
|
| + * @param {string=} title
|
| + */
|
| + setWorked(worked, title) {
|
| + this._worked = worked;
|
| + this._progressElement.value = worked;
|
| + if (title)
|
| + this.setTitle(title);
|
| + }
|
|
|
| - /**
|
| - * @override
|
| - * @param {number=} worked
|
| - */
|
| - worked: function(worked)
|
| - {
|
| - this.setWorked(this._worked + (worked || 1));
|
| - }
|
| + /**
|
| + * @override
|
| + * @param {number=} worked
|
| + */
|
| + worked(worked) {
|
| + this.setWorked(this._worked + (worked || 1));
|
| + }
|
| };
|
|
|