1 // Copyright (c) 2012 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 var onMessageReply = function(message) {
6 var enabled = (message == 'start enabled');
7 var id = chrome.contextMenus.create({'title': 'Extension Item 1',
8 'enabled': enabled}, function() {
9 chrome.test.sendMessage('create', function(message) {
10 chrome.contextMenus.update(id, {'enabled': !enabled}, function() {
11 chrome.test.sendMessage('update');
17 chrome.test.sendMessage('begin', onMessageReply);