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
|| {};
16 remoting
.ContextMenuAdapter = function() {
20 * @param {string} id An identifier for the menu entry.
21 * @param {string} title The text to display in the menu.
22 * @param {boolean} isCheckable True if the state of this menu entry should
23 * have a check-box and manage its toggle state automatically. Note that
24 * checkable menu entries always start off unchecked; use updateCheckState
25 * to programmatically change the state.
26 * @param {string=} opt_parentId The id of the parent menu item for submenus.
28 remoting
.ContextMenuAdapter
.prototype.create = function(
29 id
, title
, isCheckable
, opt_parentId
) {
34 * @param {string} title
36 remoting
.ContextMenuAdapter
.prototype.updateTitle = function(id
, title
) {
41 * @param {boolean} checked
43 remoting
.ContextMenuAdapter
.prototype.updateCheckState = function(id
, checked
) {
49 remoting
.ContextMenuAdapter
.prototype.remove = function(id
) {
53 * @param {function(OnClickData=):void} listener
55 remoting
.ContextMenuAdapter
.prototype.addListener = function(listener
) {