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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/perf_ui/TimelineOverviewPane.js

Issue 2888683002: DevTools: Fix timeline overview popover sticking at last (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/perf_ui/timelineOverviewInfo.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 /** 64 /**
65 * @param {!Event} event 65 * @param {!Event} event
66 */ 66 */
67 _onMouseMove(event) { 67 _onMouseMove(event) {
68 if (!this._cursorEnabled) 68 if (!this._cursorEnabled)
69 return; 69 return;
70 this._cursorPosition = event.offsetX + event.target.offsetLeft; 70 this._cursorPosition = event.offsetX + event.target.offsetLeft;
71 this._cursorElement.style.left = this._cursorPosition + 'px'; 71 this._cursorElement.style.left = this._cursorPosition + 'px';
72 this._cursorElement.style.visibility = 'visible'; 72 this._cursorElement.style.visibility = 'visible';
73 this._buildOverviewInfo().then(content => this._overviewInfo.setContent(cont ent)); 73 this._overviewInfo.setContent(this._buildOverviewInfo());
74 } 74 }
75 75
76 /** 76 /**
77 * @return {!Promise<!DocumentFragment>} 77 * @return {!Promise<!DocumentFragment>}
78 */ 78 */
79 async _buildOverviewInfo() { 79 async _buildOverviewInfo() {
80 var document = this.element.ownerDocument; 80 var document = this.element.ownerDocument;
81 var x = this._cursorPosition; 81 var x = this._cursorPosition;
82 var elements = await Promise.all(this._overviewControls.map(control => contr ol.overviewInfoPromise(x))); 82 var elements = await Promise.all(this._overviewControls.map(control => contr ol.overviewInfoPromise(x)));
83 var fragment = document.createDocumentFragment(); 83 var fragment = document.createDocumentFragment();
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 PerfUI.TimelineOverviewPane.OverviewInfo = class { 475 PerfUI.TimelineOverviewPane.OverviewInfo = class {
476 /** 476 /**
477 * @param {!Element} anchor 477 * @param {!Element} anchor
478 */ 478 */
479 constructor(anchor) { 479 constructor(anchor) {
480 this._anchorElement = anchor; 480 this._anchorElement = anchor;
481 this._glassPane = new UI.GlassPane(); 481 this._glassPane = new UI.GlassPane();
482 this._glassPane.setPointerEventsBehavior(UI.GlassPane.PointerEventsBehavior. PierceContents); 482 this._glassPane.setPointerEventsBehavior(UI.GlassPane.PointerEventsBehavior. PierceContents);
483 this._glassPane.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow); 483 this._glassPane.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow);
484 this._glassPane.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); 484 this._glassPane.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
485 this._visible = false;
485 this._element = 486 this._element =
486 UI.createShadowRootWithCoreStyles(this._glassPane.contentElement, 'perf_ ui/timelineOverviewInfo.css') 487 UI.createShadowRootWithCoreStyles(this._glassPane.contentElement, 'perf_ ui/timelineOverviewInfo.css')
487 .createChild('div', 'overview-info'); 488 .createChild('div', 'overview-info');
488 } 489 }
489 490
490 /** 491 /**
491 * @param {!DocumentFragment} content 492 * @param {!Promise<!DocumentFragment>} contentPromise
492 */ 493 */
493 setContent(content) { 494 async setContent(contentPromise) {
495 this._visible = true;
496 var content = await contentPromise;
497 if (!this._visible)
498 return;
494 this._element.removeChildren(); 499 this._element.removeChildren();
495 this._element.appendChild(content); 500 this._element.appendChild(content);
496 this._glassPane.setContentAnchorBox(this._anchorElement.boxInWindow()); 501 this._glassPane.setContentAnchorBox(this._anchorElement.boxInWindow());
497 if (!this._glassPane.isShowing()) 502 if (!this._glassPane.isShowing())
498 this._glassPane.show(/** @type {!Document} */ (this._anchorElement.ownerDo cument)); 503 this._glassPane.show(/** @type {!Document} */ (this._anchorElement.ownerDo cument));
499 } 504 }
500 505
501 hide() { 506 hide() {
507 this._visible = false;
502 this._glassPane.hide(); 508 this._glassPane.hide();
503 } 509 }
504 }; 510 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/perf_ui/timelineOverviewInfo.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698