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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Popover.js

Issue 2790613003: Reland of [DevTools] Migrate SoftContextMenu to use GlassPane (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 199 }
200 200
201 /** 201 /**
202 * @param {!Document} document 202 * @param {!Document} document
203 */ 203 */
204 _showPopover(document) { 204 _showPopover(document) {
205 var popover = new UI.GlassPane(); 205 var popover = new UI.GlassPane();
206 popover.registerRequiredCSS('ui/popover.css'); 206 popover.registerRequiredCSS('ui/popover.css');
207 popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); 207 popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
208 popover.setBlockPointerEvents(false); 208 popover.setBlockPointerEvents(false);
209 popover.setShowArrow(true); 209 popover.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow);
210 var request = this._scheduledRequest; 210 var request = this._scheduledRequest;
211 request.show.call(null, popover).then(success => { 211 request.show.call(null, popover).then(success => {
212 if (!success) 212 if (!success)
213 return; 213 return;
214 214
215 if (this._scheduledRequest !== request) { 215 if (this._scheduledRequest !== request) {
216 if (request.hide) 216 if (request.hide)
217 request.hide.call(null); 217 request.hide.call(null);
218 return; 218 return;
219 } 219 }
(...skipping 27 matching lines...) Expand all
247 delete this._hidePopoverTimer; 247 delete this._hidePopoverTimer;
248 248
249 // We know that we reached the popup, but we might have moved over other ele ments. 249 // We know that we reached the popup, but we might have moved over other ele ments.
250 // Discard pending command. 250 // Discard pending command.
251 this._stopShowPopoverTimer(); 251 this._stopShowPopoverTimer();
252 } 252 }
253 }; 253 };
254 254
255 /** @typedef {{box: !AnchorBox, show:(function(!UI.GlassPane):!Promise<boolean>) , hide:(function()|undefined)}} */ 255 /** @typedef {{box: !AnchorBox, show:(function(!UI.GlassPane):!Promise<boolean>) , hide:(function()|undefined)}} */
256 UI.PopoverRequest; 256 UI.PopoverRequest;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698