1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * Wrapper interface for chrome.contextMenus.
12 /** @suppress {duplicate} */
13 var remoting
= remoting
|| {};
17 * @extends {base.Disposable}
19 remoting
.ContextMenuAdapter = function() {
23 * @param {string} id An identifier for the menu entry.
24 * @param {string} title The text to display in the menu.
25 * @param {boolean} isCheckable True if the state of this menu entry should
26 * have a check-box and manage its toggle state automatically. Note that
27 * checkable menu entries always start off unchecked; use updateCheckState
28 * to programmatically change the state.
29 * @param {string=} opt_parentId The id of the parent menu item for submenus.
31 remoting
.ContextMenuAdapter
.prototype.create = function(
32 id
, title
, isCheckable
, opt_parentId
) {
37 * @param {string} title
39 remoting
.ContextMenuAdapter
.prototype.updateTitle = function(id
, title
) {
44 * @param {boolean} checked
46 remoting
.ContextMenuAdapter
.prototype.updateCheckState = function(id
, checked
) {
52 remoting
.ContextMenuAdapter
.prototype.remove = function(id
) {
56 * @param {function(OnClickData=):void} listener
58 remoting
.ContextMenuAdapter
.prototype.addListener = function(listener
) {