Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 380 this._softMenu.discard(); | 380 this._softMenu.discard(); |
| 381 } | 381 } |
| 382 | 382 |
| 383 _innerShow() { | 383 _innerShow() { |
| 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 | |
| 391 UI._contextMenu = this; | |
|
luoe
2017/05/22 17:50:47
Added: https://chromium.googlesource.com/chromium/
| |
| 392 if (this._useSoftMenu || UI.ContextMenu._useSoftMenu || InspectorFrontendHos t.isHostedMode()) { | 390 if (this._useSoftMenu || UI.ContextMenu._useSoftMenu || InspectorFrontendHos t.isHostedMode()) { |
| 393 this._softMenu = new UI.SoftContextMenu(menuObject, this._itemSelected.bin d(this)); | 391 this._softMenu = new UI.SoftContextMenu(menuObject, this._itemSelected.bin d(this)); |
| 394 this._softMenu.show(this._event.target.ownerDocument, new AnchorBox(this._ x, this._y, 0, 0)); | 392 this._softMenu.show(this._event.target.ownerDocument, new AnchorBox(this._ x, this._y, 0, 0)); |
| 395 } else { | 393 } else { |
| 396 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, menuObject, this._event.target.ownerDocument); | 394 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, menuObject, this._event.target.ownerDocument); |
| 397 | 395 |
| 398 /** | 396 /** |
| 399 * @this {UI.ContextMenu} | 397 * @this {UI.ContextMenu} |
| 400 */ | 398 */ |
| 401 function listenToEvents() { | 399 function listenToEvents() { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 477 UI.ContextMenu.Provider = function() {}; | 475 UI.ContextMenu.Provider = function() {}; |
| 478 | 476 |
| 479 UI.ContextMenu.Provider.prototype = { | 477 UI.ContextMenu.Provider.prototype = { |
| 480 /** | 478 /** |
| 481 * @param {!Event} event | 479 * @param {!Event} event |
| 482 * @param {!UI.ContextMenu} contextMenu | 480 * @param {!UI.ContextMenu} contextMenu |
| 483 * @param {!Object} target | 481 * @param {!Object} target |
| 484 */ | 482 */ |
| 485 appendApplicableItems(event, contextMenu, target) {} | 483 appendApplicableItems(event, contextMenu, target) {} |
| 486 }; | 484 }; |
| OLD | NEW |