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

Side by Side Diff: chrome/browser/resources/shared/js/cr/ui/context_menu_handler.js

Issue 8993007: WebUI TaskManager: Delay scripts loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: marge with master Created 8 years, 11 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 | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/task_manager/includes.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 6
7 const Menu = cr.ui.Menu; 7 const Menu = cr.ui.Menu;
8 8
9 /** 9 /**
10 * Handles context menus. 10 * Handles context menus.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 if (!element.getRectForContextMenu) { 205 if (!element.getRectForContextMenu) {
206 /** 206 /**
207 * @return {!ClientRect} The rect to use for positioning the context 207 * @return {!ClientRect} The rect to use for positioning the context
208 * menu when the context menu is not opened using a mouse position. 208 * menu when the context menu is not opened using a mouse position.
209 */ 209 */
210 element.getRectForContextMenu = function() { 210 element.getRectForContextMenu = function() {
211 return this.getBoundingClientRect(); 211 return this.getBoundingClientRect();
212 }; 212 };
213 } 213 }
214 },
215
216 /**
217 * Sets the given contextMenu to the given element. A contextMenu property
218 * would be added if necessary.
219 * @param {!Element} element The element or class to set the contextMenu to.
220 * @param {!cr.ui.Menu} contextMenu The contextMenu property to be set.
221 */
222 setContextMenu: function(element, contextMenu) {
223 if (!element.contextMenu)
224 this.addContextMenuProperty(element);
225 element.contextMenu = contextMenu;
214 } 226 }
215 }; 227 };
216 228
217 /** 229 /**
218 * The singleton context menu handler. 230 * The singleton context menu handler.
219 * @type {!ContextMenuHandler} 231 * @type {!ContextMenuHandler}
220 */ 232 */
221 var contextMenuHandler = new ContextMenuHandler; 233 var contextMenuHandler = new ContextMenuHandler;
222 234
223 // Export 235 // Export
224 return { 236 return {
225 contextMenuHandler: contextMenuHandler 237 contextMenuHandler: contextMenuHandler
226 }; 238 };
227 }); 239 });
OLDNEW
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/task_manager/includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698