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/ui/ContextMenu.js

Issue 2778623002: [DevTools] Migrate SoftContextMenu to use GlassPane (Closed)
Patch Set: rebased 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 if (typeof this._beforeShow === 'function') { 384 if (typeof this._beforeShow === 'function') {
385 this._beforeShow(); 385 this._beforeShow();
386 delete this._beforeShow; 386 delete this._beforeShow;
387 } 387 }
388 388
389 var menuObject = this._buildDescriptors(); 389 var menuObject = this._buildDescriptors();
390 390
391 UI._contextMenu = this; 391 UI._contextMenu = this;
392 if (this._useSoftMenu || UI.ContextMenu._useSoftMenu || InspectorFrontendHos t.isHostedMode()) { 392 if (this._useSoftMenu || UI.ContextMenu._useSoftMenu || InspectorFrontendHos t.isHostedMode()) {
393 this._softMenu = new UI.SoftContextMenu(menuObject, this._itemSelected.bin d(this)); 393 this._softMenu = new UI.SoftContextMenu(menuObject, this._itemSelected.bin d(this));
394 this._softMenu.show(this._event.target.ownerDocument, this._x, this._y); 394 this._softMenu.show(this._event.target.ownerDocument, new AnchorBox(this._ x, this._y, 0, 0));
395 } else { 395 } else {
396 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, menuObject, this._event.target.ownerDocument); 396 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, menuObject, this._event.target.ownerDocument);
397 397
398 /** 398 /**
399 * @this {UI.ContextMenu} 399 * @this {UI.ContextMenu}
400 */ 400 */
401 function listenToEvents() { 401 function listenToEvents() {
402 InspectorFrontendHost.events.addEventListener( 402 InspectorFrontendHost.events.addEventListener(
403 InspectorFrontendHostAPI.Events.ContextMenuCleared, this._menuCleare d, this); 403 InspectorFrontendHostAPI.Events.ContextMenuCleared, this._menuCleare d, this);
404 InspectorFrontendHost.events.addEventListener( 404 InspectorFrontendHost.events.addEventListener(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 UI.ContextMenu.Provider = function() {}; 477 UI.ContextMenu.Provider = function() {};
478 478
479 UI.ContextMenu.Provider.prototype = { 479 UI.ContextMenu.Provider.prototype = {
480 /** 480 /**
481 * @param {!Event} event 481 * @param {!Event} event
482 * @param {!UI.ContextMenu} contextMenu 482 * @param {!UI.ContextMenu} contextMenu
483 * @param {!Object} target 483 * @param {!Object} target
484 */ 484 */
485 appendApplicableItems(event, contextMenu, target) {} 485 appendApplicableItems(event, contextMenu, target) {}
486 }; 486 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698