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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/components/BreakpointsSidebarPaneBase.js

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: all done Created 4 years, 1 month 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
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
11 * copyright notice, this list of conditions and the following disclaimer 11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the 12 * in the documentation and/or other materials provided with the
13 * distribution. 13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its 14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from 15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission. 16 * this software without specific prior written permission.
17 * 17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
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 /**
31 * @unrestricted
32 */
33 WebInspector.BreakpointsSidebarPaneBase = class extends WebInspector.VBox {
34 constructor() {
35 super();
36 this.registerRequiredCSS('components/breakpointsList.css');
30 37
31 /** 38 this.listElement = createElement('ol');
32 * @constructor 39 this.listElement.className = 'breakpoint-list';
33 * @extends {WebInspector.VBox}
34 */
35 WebInspector.BreakpointsSidebarPaneBase = function()
36 {
37 WebInspector.VBox.call(this);
38 this.registerRequiredCSS("components/breakpointsList.css");
39 40
40 this.listElement = createElement("ol"); 41 this.emptyElement = createElement('div');
41 this.listElement.className = "breakpoint-list"; 42 this.emptyElement.className = 'gray-info-message';
42 43 this.emptyElement.textContent = WebInspector.UIString('No Breakpoints');
43 this.emptyElement = createElement("div");
44 this.emptyElement.className = "gray-info-message";
45 this.emptyElement.textContent = WebInspector.UIString("No Breakpoints");
46 44
47 this.element.appendChild(this.emptyElement); 45 this.element.appendChild(this.emptyElement);
46 }
47
48 /**
49 * @param {!Element} element
50 * @param {?Node=} beforeNode
51 * @protected
52 */
53 addListElement(element, beforeNode) {
54 if (beforeNode) {
55 this.listElement.insertBefore(element, beforeNode);
56 } else {
57 if (!this.listElement.firstChild) {
58 this.element.removeChild(this.emptyElement);
59 this.element.appendChild(this.listElement);
60 }
61 this.listElement.appendChild(element);
62 }
63 }
64
65 /**
66 * @param {!Element} element
67 * @protected
68 */
69 removeListElement(element) {
70 this.listElement.removeChild(element);
71 if (!this.listElement.firstChild) {
72 this.element.removeChild(this.listElement);
73 this.element.appendChild(this.emptyElement);
74 }
75 }
76
77 /**
78 * @protected
79 */
80 reset() {
81 this.listElement.removeChildren();
82 if (this.listElement.parentElement) {
83 this.element.removeChild(this.listElement);
84 this.element.appendChild(this.emptyElement);
85 }
86 }
48 }; 87 };
49
50 WebInspector.BreakpointsSidebarPaneBase.prototype = {
51 /**
52 * @param {!Element} element
53 * @param {?Node=} beforeNode
54 * @protected
55 */
56 addListElement: function(element, beforeNode)
57 {
58 if (beforeNode) {
59 this.listElement.insertBefore(element, beforeNode);
60 } else {
61 if (!this.listElement.firstChild) {
62 this.element.removeChild(this.emptyElement);
63 this.element.appendChild(this.listElement);
64 }
65 this.listElement.appendChild(element);
66 }
67 },
68
69 /**
70 * @param {!Element} element
71 * @protected
72 */
73 removeListElement: function(element)
74 {
75 this.listElement.removeChild(element);
76 if (!this.listElement.firstChild) {
77 this.element.removeChild(this.listElement);
78 this.element.appendChild(this.emptyElement);
79 }
80 },
81
82 /**
83 * @protected
84 */
85 reset: function()
86 {
87 this.listElement.removeChildren();
88 if (this.listElement.parentElement) {
89 this.element.removeChild(this.listElement);
90 this.element.appendChild(this.emptyElement);
91 }
92 },
93
94 __proto__: WebInspector.VBox.prototype
95 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698