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

Unified Diff: third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.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/source_frame/UISourceCodeFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
index c9f57c925e5bd3f8db65e0bfeb759582121ae54e..d1db34bc172d7a4e7f1c63f980909b3ba00c62fb 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
@@ -74,6 +74,7 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
this._errorPopoverHelper = new UI.PopoverHelper(this.element);
this._errorPopoverHelper.initializeCallbacks(this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this));
+ this._errorPopoverHelper.setHasPadding(true);
this._errorPopoverHelper.setTimeout(100, 100);
@@ -400,14 +401,17 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
/**
* @param {!Element} anchor
- * @param {!UI.Popover} popover
+ * @param {!UI.GlassPane} popover
+ * @return {!Promise<boolean>}
*/
_showErrorPopover(anchor, popover) {
var messageBucket = anchor.enclosingNodeOrSelfWithClass('text-editor-line-decoration')._messageBucket;
var messagesOutline = messageBucket.messagesDescription();
- var popoverAnchor =
- anchor.enclosingNodeOrSelfWithClass('text-editor-line-decoration-icon') ? anchor : this._errorWavePopoverAnchor;
- popover.showForAnchor(messagesOutline, popoverAnchor);
+ popover.setContentAnchorBox(
+ anchor.enclosingNodeOrSelfWithClass('text-editor-line-decoration-icon') ? anchor.boxInWindow() :
+ this._errorWavePopoverAnchor);
+ popover.contentElement.appendChild(messagesOutline);
+ return Promise.resolve(true);
}
_updateBucketDecorations() {

Powered by Google App Engine
This is Rietveld 408576698