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

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

Issue 2710203003: [DevTools] show inlined shortcuts for go to location (Closed)
Patch Set: addressed comments Created 3 years, 9 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (!response || this._disposed) 88 if (!response || this._disposed)
89 return; 89 return;
90 90
91 var container = createElementWithClass('div', 'object-popover-container'); 91 var container = createElementWithClass('div', 'object-popover-container');
92 var title = container.createChild('div', 'function-popover-title source-co de'); 92 var title = container.createChild('div', 'function-popover-title source-co de');
93 var functionName = title.createChild('span', 'function-name'); 93 var functionName = title.createChild('span', 'function-name');
94 functionName.textContent = UI.beautifyFunctionName(response.functionName); 94 functionName.textContent = UI.beautifyFunctionName(response.functionName);
95 95
96 var rawLocation = response.location; 96 var rawLocation = response.location;
97 var linkContainer = title.createChild('div', 'function-title-link-containe r'); 97 var linkContainer = title.createChild('div', 'function-title-link-containe r');
98 if (rawLocation && Runtime.experiments.isEnabled('continueToFirstInvocatio n')) {
99 var sectionToolbar = new UI.Toolbar('function-location-step-into', linkC ontainer);
100 var stepInto = new UI.ToolbarButton(Common.UIString('Continue to first i nvocation'), 'largeicon-step-in');
101 stepInto.addEventListener(UI.ToolbarButton.Events.Click, () => rawLocati on.continueToLocation());
102 sectionToolbar.appendToolbarItem(stepInto);
103 }
104 var sourceURL = rawLocation && rawLocation.script() ? rawLocation.script() .sourceURL : null; 98 var sourceURL = rawLocation && rawLocation.script() ? rawLocation.script() .sourceURL : null;
105 if (rawLocation && sourceURL) 99 if (rawLocation && sourceURL)
106 linkContainer.appendChild(this._lazyLinkifier().linkifyRawLocation(rawLo cation, sourceURL)); 100 linkContainer.appendChild(this._lazyLinkifier().linkifyRawLocation(rawLo cation, sourceURL));
107 container.appendChild(popoverContentElement); 101 container.appendChild(popoverContentElement);
108 popover.showForAnchor(container, anchorElement); 102 popover.showForAnchor(container, anchorElement);
109 } 103 }
110 104
111 /** 105 /**
112 * @param {!SDK.RemoteObject} result 106 * @param {!SDK.RemoteObject} result
113 * @param {boolean} wasThrown 107 * @param {boolean} wasThrown
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 * @return {!Components.Linkifier} 189 * @return {!Components.Linkifier}
196 */ 190 */
197 _lazyLinkifier() { 191 _lazyLinkifier() {
198 if (!this._linkifier) 192 if (!this._linkifier)
199 this._linkifier = new Components.Linkifier(); 193 this._linkifier = new Components.Linkifier();
200 return this._linkifier; 194 return this._linkifier;
201 } 195 }
202 }; 196 };
203 197
204 ObjectUI.ObjectPopoverHelper.MaxPopoverTextLength = 10000; 198 ObjectUI.ObjectPopoverHelper.MaxPopoverTextLength = 10000;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698