| 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |