Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/common/extensions/docs/examples/api/contextMenus/event_page/sample.js

Issue 11745015: Update references to the extension messaging APIs to point to the "runtime" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The onClicked callback function. 5 // The onClicked callback function.
6 function onClickHandler(info, tab) { 6 function onClickHandler(info, tab) {
7 if (info.menuItemId == "radio1" || info.menuItemId == "radio2") { 7 if (info.menuItemId == "radio1" || info.menuItemId == "radio2") {
8 console.log("radio item " + info.menuItemId + 8 console.log("radio item " + info.menuItemId +
9 " was clicked (previous checked state was " + 9 " was clicked (previous checked state was " +
10 info.wasChecked + ")"); 10 info.wasChecked + ")");
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 {"title": "Checkbox1", "type": "checkbox", "id": "checkbox1"}); 56 {"title": "Checkbox1", "type": "checkbox", "id": "checkbox1"});
57 chrome.contextMenus.create( 57 chrome.contextMenus.create(
58 {"title": "Checkbox2", "type": "checkbox", "id": "checkbox2"}); 58 {"title": "Checkbox2", "type": "checkbox", "id": "checkbox2"});
59 console.log("checkbox1 checkbox2"); 59 console.log("checkbox1 checkbox2");
60 60
61 // Intentionally create an invalid item, to show off error checking in the 61 // Intentionally create an invalid item, to show off error checking in the
62 // create callback. 62 // create callback.
63 console.log("About to try creating an invalid item - an error about " + 63 console.log("About to try creating an invalid item - an error about " +
64 "duplicate item child1 should show up"); 64 "duplicate item child1 should show up");
65 chrome.contextMenus.create({"title": "Oops", "id": "child1"}, function() { 65 chrome.contextMenus.create({"title": "Oops", "id": "child1"}, function() {
66 if (chrome.extension.lastError) { 66 if (chrome.runtime.lastError) {
67 console.log("Got expected error: " + chrome.extension.lastError.message); 67 console.log("Got expected error: " + chrome.runtime.lastError.message);
68 } 68 }
69 }); 69 });
70 }); 70 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698