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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js

Issue 2604883002: DevTools: namespace globals (Closed)
Patch Set: address CL feedback Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Google Inc. All rights reserved. 3 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 continue; 136 continue;
137 var property = properties[i].value; 137 var property = properties[i].value;
138 var title = property.description; 138 var title = property.description;
139 title = title.replace(/Prototype$/, ''); 139 title = title.replace(/Prototype$/, '');
140 var section = new Components.ObjectPropertiesSection(property, title); 140 var section = new Components.ObjectPropertiesSection(property, title);
141 section.element.classList.add('properties-widget-section'); 141 section.element.classList.add('properties-widget-section');
142 this.sections.push(section); 142 this.sections.push(section);
143 this.element.appendChild(section.element); 143 this.element.appendChild(section.element);
144 if (expanded[this.sections.length - 1]) 144 if (expanded[this.sections.length - 1])
145 section.expand(); 145 section.expand();
146 section.addEventListener(TreeOutline.Events.ElementExpanded, this._prope rtyExpanded, this); 146 section.addEventListener(UI.TreeOutline.Events.ElementExpanded, this._pr opertyExpanded, this);
147 } 147 }
148 } 148 }
149 } 149 }
150 150
151 /** 151 /**
152 * @param {!Common.Event} event 152 * @param {!Common.Event} event
153 */ 153 */
154 _propertyExpanded(event) { 154 _propertyExpanded(event) {
155 Host.userMetrics.actionTaken(Host.UserMetrics.Action.DOMPropertiesExpanded); 155 Host.userMetrics.actionTaken(Host.UserMetrics.Action.DOMPropertiesExpanded);
156 for (var section of this.sections) 156 for (var section of this.sections)
157 section.removeEventListener(TreeOutline.Events.ElementExpanded, this._prop ertyExpanded, this); 157 section.removeEventListener(UI.TreeOutline.Events.ElementExpanded, this._p ropertyExpanded, this);
158 } 158 }
159 159
160 /** 160 /**
161 * @param {!Common.Event} event 161 * @param {!Common.Event} event
162 */ 162 */
163 _onNodeChange(event) { 163 _onNodeChange(event) {
164 if (!this._node) 164 if (!this._node)
165 return; 165 return;
166 var data = event.data; 166 var data = event.data;
167 var node = /** @type {!SDK.DOMNode} */ (data instanceof SDK.DOMNode ? data : data.node); 167 var node = /** @type {!SDK.DOMNode} */ (data instanceof SDK.DOMNode ? data : data.node);
168 if (this._node !== node) 168 if (this._node !== node)
169 return; 169 return;
170 this.update(); 170 this.update();
171 } 171 }
172 }; 172 };
173 173
174 Elements.PropertiesWidget._objectGroupName = 'properties-sidebar-pane'; 174 Elements.PropertiesWidget._objectGroupName = 'properties-sidebar-pane';
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698