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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 { | 226 { |
227 return this._id++; | 227 return this._id++; |
228 }, | 228 }, |
229 | 229 |
230 show: function() | 230 show: function() |
231 { | 231 { |
232 var menuObject = this._buildDescriptor(); | 232 var menuObject = this._buildDescriptor(); |
233 | 233 |
234 if (menuObject.length) { | 234 if (menuObject.length) { |
235 WebInspector._contextMenu = this; | 235 WebInspector._contextMenu = this; |
236 if (WebInspector.ContextMenu._useSoftMenu || InspectorFrontendHost.i
sStub()) { | 236 if (WebInspector.ContextMenu._useSoftMenu || InspectorFrontendHost.i
sHostedMode()) { |
237 var softMenu = new WebInspector.SoftContextMenu(menuObject, this
._itemSelected.bind(this)); | 237 var softMenu = new WebInspector.SoftContextMenu(menuObject, this
._itemSelected.bind(this)); |
238 softMenu.show(this._event.x, this._event.y); | 238 softMenu.show(this._event.x, this._event.y); |
239 } else { | 239 } else { |
240 InspectorFrontendHost.showContextMenuAtPoint(this._event.x, this
._event.y, menuObject); | 240 InspectorFrontendHost.showContextMenuAtPoint(this._event.x, this
._event.y, menuObject); |
241 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuCleared, this._menuCleared, this); | 241 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuCleared, this._menuCleared, this); |
242 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuItemSelected, this._onItemSelected, this); | 242 InspectorFrontendHost.events.addEventListener(InspectorFrontendH
ostAPI.Events.ContextMenuItemSelected, this._onItemSelected, this); |
243 } | 243 } |
244 this._event.consume(true); | 244 this._event.consume(true); |
245 } | 245 } |
246 }, | 246 }, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 | 321 |
322 WebInspector.ContextMenu.Provider.prototype = { | 322 WebInspector.ContextMenu.Provider.prototype = { |
323 /** | 323 /** |
324 * @param {!Event} event | 324 * @param {!Event} event |
325 * @param {!WebInspector.ContextMenu} contextMenu | 325 * @param {!WebInspector.ContextMenu} contextMenu |
326 * @param {!Object} target | 326 * @param {!Object} target |
327 */ | 327 */ |
328 appendApplicableItems: function(event, contextMenu, target) { } | 328 appendApplicableItems: function(event, contextMenu, target) { } |
329 } | 329 } |
OLD | NEW |