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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 var menuObject = this._buildDescriptor(); | 216 var menuObject = this._buildDescriptor(); |
217 | 217 |
218 if (menuObject.length) { | 218 if (menuObject.length) { |
219 WebInspector._contextMenu = this; | 219 WebInspector._contextMenu = this; |
220 if (WebInspector.ContextMenu._useSoftMenu) { | 220 if (WebInspector.ContextMenu._useSoftMenu) { |
221 var softMenu = new WebInspector.SoftContextMenu(menuObject); | 221 var softMenu = new WebInspector.SoftContextMenu(menuObject); |
222 softMenu.show(this._event); | 222 softMenu.show(this._event); |
223 } else { | 223 } else { |
224 InspectorFrontendHost.showContextMenu(this._event, menuObject); | 224 InspectorFrontendHost.showContextMenu(this._event, menuObject); |
225 } | 225 } |
226 this._event.consume(); | 226 this._event.consume(true); |
227 } | 227 } |
228 }, | 228 }, |
229 | 229 |
230 _setHandler: function(id, handler) | 230 _setHandler: function(id, handler) |
231 { | 231 { |
232 if (handler) | 232 if (handler) |
233 this._handlers[id] = handler; | 233 this._handlers[id] = handler; |
234 }, | 234 }, |
235 | 235 |
236 _buildDescriptor: function() | 236 _buildDescriptor: function() |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 { | 288 { |
289 if (WebInspector._contextMenu) | 289 if (WebInspector._contextMenu) |
290 WebInspector._contextMenu._itemSelected(id); | 290 WebInspector._contextMenu._itemSelected(id); |
291 } | 291 } |
292 | 292 |
293 WebInspector.contextMenuCleared = function() | 293 WebInspector.contextMenuCleared = function() |
294 { | 294 { |
295 // FIXME: Unfortunately, contextMenuCleared is invoked between show and item
selected | 295 // FIXME: Unfortunately, contextMenuCleared is invoked between show and item
selected |
296 // so we can't delete last menu object from WebInspector. Fix the contract. | 296 // so we can't delete last menu object from WebInspector. Fix the contract. |
297 } | 297 } |
OLD | NEW |