Rewrite AndroidSyncSettings to be significantly simpler.
[chromium-blink-merge.git] / remoting / webapp / app_remoting / js / context_menu_adapter.js
blobab4180fd9b5a48b128190ff4d58fbbea98d6da45
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.
5 /**
6 * @fileoverview
7 * Wrapper interface for chrome.contextMenus.
8 */
10 'use strict';
12 /** @suppress {duplicate} */
13 var remoting = remoting || {};
15 /** @interface */
16 remoting.ContextMenuAdapter = function() {
19 /**
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) {
32 /**
33 * @param {string} id
34 * @param {string} title
36 remoting.ContextMenuAdapter.prototype.updateTitle = function(id, title) {
39 /**
40 * @param {string} id
41 * @param {boolean} checked
43 remoting.ContextMenuAdapter.prototype.updateCheckState = function(id, checked) {
46 /**
47 * @param {string} id
49 remoting.ContextMenuAdapter.prototype.remove = function(id) {
52 /**
53 * @param {function(OnClickData=):void} listener
55 remoting.ContextMenuAdapter.prototype.addListener = function(listener) {