| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 }, | 287 }, |
| 288 | 288 |
| 289 _innerShow: function() | 289 _innerShow: function() |
| 290 { | 290 { |
| 291 var menuObject = this._buildDescriptor(); | 291 var menuObject = this._buildDescriptor(); |
| 292 | 292 |
| 293 if (menuObject.length) { | 293 if (menuObject.length) { |
| 294 WebInspector._contextMenu = this; | 294 WebInspector._contextMenu = this; |
| 295 if (WebInspector.ContextMenu._useSoftMenu || InspectorFrontendHost.i
sHostedMode()) { | 295 if (WebInspector.ContextMenu._useSoftMenu || InspectorFrontendHost.i
sHostedMode()) { |
| 296 var softMenu = new WebInspector.SoftContextMenu(menuObject, this
._itemSelected.bind(this)); | 296 var softMenu = new WebInspector.SoftContextMenu(menuObject, this
._itemSelected.bind(this)); |
| 297 softMenu.show(this._x, this._y); | 297 softMenu.show(this._event.target.ownerDocument, this._x, this._y
); |
| 298 } else { | 298 } else { |
| 299 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, m
enuObject); | 299 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, m
enuObject); |
| 300 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuCleared, this._menuCleared, this); | 300 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuCleared, this._menuCleared, this); |
| 301 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuItemSelected, this._onItemSelected, this); | 301 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuItemSelected, this._onItemSelected, this); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 }, | 304 }, |
| 305 | 305 |
| 306 /** | 306 /** |
| 307 * @param {number} id | 307 * @param {number} id |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 367 } |
| 368 | 368 |
| 369 WebInspector.ContextMenu.Provider.prototype = { | 369 WebInspector.ContextMenu.Provider.prototype = { |
| 370 /** | 370 /** |
| 371 * @param {!Event} event | 371 * @param {!Event} event |
| 372 * @param {!WebInspector.ContextMenu} contextMenu | 372 * @param {!WebInspector.ContextMenu} contextMenu |
| 373 * @param {!Object} target | 373 * @param {!Object} target |
| 374 */ | 374 */ |
| 375 appendApplicableItems: function(event, contextMenu, target) { } | 375 appendApplicableItems: function(event, contextMenu, target) { } |
| 376 } | 376 } |
| OLD | NEW |