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

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

Issue 2112673003: [DevTools] Move suspended generator location to internal properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 if (rawLocation && sourceURL) { 106 if (rawLocation && sourceURL) {
107 var link = this._lazyLinkifier().linkifyRawLocation(rawLocation, sourceURL); 107 var link = this._lazyLinkifier().linkifyRawLocation(rawLocation, sourceURL);
108 linkContainer.appendChild(link); 108 linkContainer.appendChild(link);
109 } 109 }
110 container.appendChild(popoverContentElement); 110 container.appendChild(popoverContentElement);
111 popover.showForAnchor(container, anchorElement); 111 popover.showForAnchor(container, anchorElement);
112 } 112 }
113 113
114 /** 114 /**
115 * @param {?WebInspector.DebuggerModel.GeneratorObjectDetails} response
116 * @this {WebInspector.ObjectPopoverHelper}
117 */
118 function didGetGeneratorObjectDetails(response)
119 {
120 if (!response || popover.disposed)
121 return;
122
123 var rawLocation = response.location;
124 var sourceURL = response.sourceURL;
125 if (rawLocation && sourceURL) {
126 var link = this._lazyLinkifier().linkifyRawLocation(rawLocation, sourceURL, "function-location-link");
127 this._titleElement.appendChild(link);
128 }
129 }
130
131 /**
132 * @param {!WebInspector.RemoteObject} result 115 * @param {!WebInspector.RemoteObject} result
133 * @param {boolean} wasThrown 116 * @param {boolean} wasThrown
134 * @param {!Element=} anchorOverride 117 * @param {!Element=} anchorOverride
135 * @this {WebInspector.ObjectPopoverHelper} 118 * @this {WebInspector.ObjectPopoverHelper}
136 */ 119 */
137 function didQueryObject(result, wasThrown, anchorOverride) 120 function didQueryObject(result, wasThrown, anchorOverride)
138 { 121 {
139 if (popover.disposed) 122 if (popover.disposed)
140 return; 123 return;
141 if (wasThrown) { 124 if (wasThrown) {
(...skipping 27 matching lines...) Expand all
169 } 152 }
170 153
171 if (result.customPreview()) { 154 if (result.customPreview()) {
172 var customPreviewComponent = new WebInspector.CustomPreviewC omponent(result); 155 var customPreviewComponent = new WebInspector.CustomPreviewC omponent(result);
173 customPreviewComponent.expandIfPossible(); 156 customPreviewComponent.expandIfPossible();
174 popoverContentElement = customPreviewComponent.element; 157 popoverContentElement = customPreviewComponent.element;
175 } else { 158 } else {
176 popoverContentElement = createElement("div"); 159 popoverContentElement = createElement("div");
177 this._titleElement = popoverContentElement.createChild("div" , "monospace"); 160 this._titleElement = popoverContentElement.createChild("div" , "monospace");
178 this._titleElement.createChild("span", "source-frame-popover -title").textContent = description; 161 this._titleElement.createChild("span", "source-frame-popover -title").textContent = description;
179 var section = new WebInspector.ObjectPropertiesSection(resul t, ""); 162 var section = new WebInspector.ObjectPropertiesSection(resul t, "", this._lazyLinkifier());
180 section.element.classList.add("source-frame-popover-tree"); 163 section.element.classList.add("source-frame-popover-tree");
181 section.titleLessMode(); 164 section.titleLessMode();
182 popoverContentElement.appendChild(section.element); 165 popoverContentElement.appendChild(section.element);
183
184 if (result.subtype === "generator")
185 result.generatorObjectDetails(didGetGeneratorObjectDetai ls.bind(this));
186 } 166 }
187 var popoverWidth = 300; 167 var popoverWidth = 300;
188 var popoverHeight = 250; 168 var popoverHeight = 250;
189 popover.showForAnchor(popoverContentElement, anchorElement, popo verWidth, popoverHeight); 169 popover.showForAnchor(popoverContentElement, anchorElement, popo verWidth, popoverHeight);
190 } 170 }
191 } 171 }
192
193 this._queryObject(element, didQueryObject.bind(this), this._popoverObjec tGroup); 172 this._queryObject(element, didQueryObject.bind(this), this._popoverObjec tGroup);
194 }, 173 },
195 174
196 _onHideObjectPopover: function() 175 _onHideObjectPopover: function()
197 { 176 {
198 if (this._resultHighlightedAsDOM) { 177 if (this._resultHighlightedAsDOM) {
199 WebInspector.DOMModel.hideDOMNodeHighlight(); 178 WebInspector.DOMModel.hideDOMNodeHighlight();
200 delete this._resultHighlightedAsDOM; 179 delete this._resultHighlightedAsDOM;
201 } 180 }
202 if (this._linkifier) { 181 if (this._linkifier) {
(...skipping 13 matching lines...) Expand all
216 */ 195 */
217 _lazyLinkifier: function() 196 _lazyLinkifier: function()
218 { 197 {
219 if (!this._linkifier) 198 if (!this._linkifier)
220 this._linkifier = new WebInspector.Linkifier(); 199 this._linkifier = new WebInspector.Linkifier();
221 return this._linkifier; 200 return this._linkifier;
222 }, 201 },
223 202
224 __proto__: WebInspector.PopoverHelper.prototype 203 __proto__: WebInspector.PopoverHelper.prototype
225 } 204 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698