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

Unified Diff: third_party/WebKit/Source/devtools/front_end/inline_editor/SwatchPopoverHelper.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/inline_editor/SwatchPopoverHelper.js
diff --git a/third_party/WebKit/Source/devtools/front_end/inline_editor/SwatchPopoverHelper.js b/third_party/WebKit/Source/devtools/front_end/inline_editor/SwatchPopoverHelper.js
index b2c943604e3d4e240a6c1acfc4710d8f4540b050..e060c8b6c6ea2a0147df84dd76721bf218c57196 100644
--- a/third_party/WebKit/Source/devtools/front_end/inline_editor/SwatchPopoverHelper.js
+++ b/third_party/WebKit/Source/devtools/front_end/inline_editor/SwatchPopoverHelper.js
@@ -7,8 +7,11 @@
InlineEditor.SwatchPopoverHelper = class extends Common.Object {
constructor() {
super();
- this._popover = new UI.Popover();
- this._popover.setNoPadding(true);
+ this._popover = new UI.GlassPane();
+ this._popover.registerRequiredCSS('inline_editor/swatchPopover.css');
+ this._popover.setBlockPointerEvents(false);
+ this._popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
+ this._popover.setShowArrow(true);
this._popover.element.addEventListener('mousedown', e => e.consume(), false);
this._hideProxy = this.hide.bind(this, true);
@@ -61,9 +64,11 @@ InlineEditor.SwatchPopoverHelper = class extends Common.Object {
}
reposition() {
- // Unbind "blur" listener to avoid reenterability: |popover.showView| will hide the popover and trigger it synchronously.
+ // Unbind "blur" listener to avoid reenterability: |popover.show()| will hide the popover and trigger it synchronously.
this._view.contentElement.removeEventListener('focusout', this._boundFocusOut, false);
- this._popover.showView(this._view, this._anchorElement);
+ this._view.show(this._popover.contentElement);
+ this._popover.setContentAnchorBox(this._anchorElement.boxInWindow());
+ this._popover.show(this._anchorElement.ownerDocument);
this._view.contentElement.addEventListener('focusout', this._boundFocusOut, false);
if (!this._focusRestorer)
this._focusRestorer = new UI.WidgetFocusRestorer(this._view);

Powered by Google App Engine
This is Rietveld 408576698