Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Side by Side Diff: Source/devtools/front_end/ui/ContextMenu.js

Issue 670123002: DevTools: open context menu in the embedder even when no custom items are there. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 this._innerShow(); 283 this._innerShow();
284 } 284 }
285 285
286 this._event.consume(true); 286 this._event.consume(true);
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 WebInspector._contextMenu = this;
294 WebInspector._contextMenu = this; 294 if (WebInspector.ContextMenu._useSoftMenu || InspectorFrontendHost.isHos tedMode()) {
295 if (WebInspector.ContextMenu._useSoftMenu || InspectorFrontendHost.i sHostedMode()) { 295 var softMenu = new WebInspector.SoftContextMenu(menuObject, this._it emSelected.bind(this));
296 var softMenu = new WebInspector.SoftContextMenu(menuObject, this ._itemSelected.bind(this)); 296 softMenu.show(this._event.target.ownerDocument, this._x, this._y);
297 softMenu.show(this._event.target.ownerDocument, this._x, this._y ); 297 } else {
298 } else { 298 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, menuO bject);
299 InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, m enuObject); 299 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostA PI.Events.ContextMenuCleared, this._menuCleared, this);
300 InspectorFrontendHost.events.addEventListener(InspectorFrontendH ostAPI.Events.ContextMenuCleared, this._menuCleared, this); 300 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostA PI.Events.ContextMenuItemSelected, this._onItemSelected, this);
301 InspectorFrontendHost.events.addEventListener(InspectorFrontendH ostAPI.Events.ContextMenuItemSelected, this._onItemSelected, this);
302 }
303 } 301 }
304 }, 302 },
305 303
306 /** 304 /**
307 * @param {number} id 305 * @param {number} id
308 * @param {function(?)} handler 306 * @param {function(?)} handler
309 */ 307 */
310 _setHandler: function(id, handler) 308 _setHandler: function(id, handler)
311 { 309 {
312 if (handler) 310 if (handler)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 } 365 }
368 366
369 WebInspector.ContextMenu.Provider.prototype = { 367 WebInspector.ContextMenu.Provider.prototype = {
370 /** 368 /**
371 * @param {!Event} event 369 * @param {!Event} event
372 * @param {!WebInspector.ContextMenu} contextMenu 370 * @param {!WebInspector.ContextMenu} contextMenu
373 * @param {!Object} target 371 * @param {!Object} target
374 */ 372 */
375 appendApplicableItems: function(event, contextMenu, target) { } 373 appendApplicableItems: function(event, contextMenu, target) { }
376 } 374 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698