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

Side by Side Diff: Source/devtools/front_end/ui/ProgressIndicator.js

Issue 367093003: DevTools: More code reduce via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @implements {WebInspector.Progress} 33 * @implements {WebInspector.Progress}
34 * @extends {WebInspector.Object} 34 * @extends {WebInspector.Object}
35 */ 35 */
36 WebInspector.ProgressIndicator = function() 36 WebInspector.ProgressIndicator = function()
37 { 37 {
38 this.element = document.createElement("div"); 38 this.element = document.createElementWithClass("div", "progress-bar-containe r");
39 this.element.className = "progress-bar-container";
40 this._labelElement = this.element.createChild("span"); 39 this._labelElement = this.element.createChild("span");
41 this._progressElement = this.element.createChild("progress"); 40 this._progressElement = this.element.createChild("progress");
42 this._stopButton = new WebInspector.StatusBarButton(WebInspector.UIString("C ancel"), "progress-bar-stop-button"); 41 this._stopButton = new WebInspector.StatusBarButton(WebInspector.UIString("C ancel"), "progress-bar-stop-button");
43 this._stopButton.addEventListener("click", this.cancel, this); 42 this._stopButton.addEventListener("click", this.cancel, this);
44 this.element.appendChild(this._stopButton.element); 43 this.element.appendChild(this._stopButton.element);
45 this._isCanceled = false; 44 this._isCanceled = false;
46 this._worked = 0; 45 this._worked = 0;
47 } 46 }
48 47
49 WebInspector.ProgressIndicator.prototype = { 48 WebInspector.ProgressIndicator.prototype = {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 /** 115 /**
117 * @param {number=} worked 116 * @param {number=} worked
118 */ 117 */
119 worked: function(worked) 118 worked: function(worked)
120 { 119 {
121 this.setWorked(this._worked + (worked || 1)); 120 this.setWorked(this._worked + (worked || 1));
122 }, 121 },
123 122
124 __proto__: WebInspector.Object.prototype 123 __proto__: WebInspector.Object.prototype
125 } 124 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineView.js ('k') | Source/devtools/front_end/ui/SettingsUI.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698