Chromium Code Reviews

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/inline_editor/SwatchPopoverHelper.js

Issue 2778623002: [DevTools] Migrate SoftContextMenu to use GlassPane (Closed)
Patch Set: rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 InlineEditor.SwatchPopoverHelper = class extends Common.Object { 7 InlineEditor.SwatchPopoverHelper = class extends Common.Object {
8 constructor() { 8 constructor() {
9 super(); 9 super();
10 this._popover = new UI.GlassPane(); 10 this._popover = new UI.GlassPane();
11 this._popover.registerRequiredCSS('inline_editor/swatchPopover.css'); 11 this._popover.registerRequiredCSS('inline_editor/swatchPopover.css');
12 this._popover.setBlockPointerEvents(false); 12 this._popover.setBlockPointerEvents(false);
13 this._popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); 13 this._popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
14 this._popover.setShowArrow(true); 14 this._popover.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow);
15 this._popover.element.addEventListener('mousedown', e => e.consume(), false) ; 15 this._popover.element.addEventListener('mousedown', e => e.consume(), false) ;
16 16
17 this._hideProxy = this.hide.bind(this, true); 17 this._hideProxy = this.hide.bind(this, true);
18 this._boundOnKeyDown = this._onKeyDown.bind(this); 18 this._boundOnKeyDown = this._onKeyDown.bind(this);
19 this._boundFocusOut = this._onFocusOut.bind(this); 19 this._boundFocusOut = this._onFocusOut.bind(this);
20 this._isHidden = true; 20 this._isHidden = true;
21 } 21 }
22 22
23 /** 23 /**
24 * @param {!Event} event 24 * @param {!Event} event
(...skipping 83 matching lines...)
108 this.hide(true); 108 this.hide(true);
109 event.consume(true); 109 event.consume(true);
110 return; 110 return;
111 } 111 }
112 if (event.key === 'Escape') { 112 if (event.key === 'Escape') {
113 this.hide(false); 113 this.hide(false);
114 event.consume(true); 114 event.consume(true);
115 } 115 }
116 } 116 }
117 }; 117 };
OLDNEW

Powered by Google App Engine