summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/panels/context_menu/test.js
blob: 1f957900dc89d56fee37bd984a8ccbda02053047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

function onclick(info) {
  chrome.test.sendMessage("clicked");
}

// Invoked by panel when it has loaded.
function panelCallback() {
  chrome.contextMenus.create({"title":"Extension Item 1",
                              "onclick": onclick}, function() {
    if (!chrome.runtime.lastError) {
      chrome.test.sendMessage("created item");
    }
  });
}

chrome.windows.create({'url': 'panel.html', 'type': 'panel'},
                      function() {});