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

Unified Diff: third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js

Issue 2740803002: [DevTools] Simplify Popover API (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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
index 261abfff41ab5c39e35ae895baaf565362ac173a..6b5486b89ad0d2481faf8d7210f19bbb2f7fc0f8 100644
--- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
+++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
@@ -173,7 +173,8 @@ Animation.AnimationTimeline = class extends UI.VBox {
/**
* @param {!Element} anchor
- * @param {!UI.Popover} popover
+ * @param {!UI.GlassPane} popover
+ * @return {!Promise<boolean>}
*/
_showPopover(anchor, popover) {
var animGroup;
@@ -184,20 +185,22 @@ Animation.AnimationTimeline = class extends UI.VBox {
console.assert(animGroup);
var screenshots = animGroup.screenshots();
if (!screenshots.length)
- return;
+ return Promise.resolve(false);
+ var fulfill;
+ var promise = new Promise(x => fulfill = x);
if (!screenshots[0].complete)
screenshots[0].onload = onFirstScreenshotLoaded.bind(null, screenshots);
else
onFirstScreenshotLoaded(screenshots);
+ return promise;
/**
* @param {!Array.<!Image>} screenshots
*/
function onFirstScreenshotLoaded(screenshots) {
- var content = new Animation.AnimationScreenshotPopover(screenshots);
- popover.setNoPadding(true);
- popover.showView(content, anchor);
+ new Animation.AnimationScreenshotPopover(screenshots).show(popover.contentElement);
+ fulfill(true);
}
}
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698