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

Side by Side Diff: chrome/common/extensions/api/extension_api.json

Issue 264046: Update browser actions api to be like new design doc. (Closed)
Patch Set: rebase Created 11 years, 2 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
OLDNEW
1 [ 1 [
2 { 2 {
3 "namespace": "extension", 3 "namespace": "extension",
4 "types": [ 4 "types": [
5 { 5 {
6 "id": "Port", 6 "id": "Port",
7 "type": "object", 7 "type": "object",
8 "description": "An object which allows two way communication with other pages.", 8 "description": "An object which allows two way communication with other pages.",
9 "properties": { 9 "properties": {
10 "name": {"type": "string"}, 10 "name": {"type": "string"},
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 817 }
818 ], 818 ],
819 "events": [ 819 "events": [
820 ] 820 ]
821 }, 821 },
822 { 822 {
823 "namespace": "browserAction", 823 "namespace": "browserAction",
824 "types": [], 824 "types": [],
825 "functions": [ 825 "functions": [
826 { 826 {
827 "name": "setName", 827 "name": "setTitle",
828 "type": "function", 828 "type": "function",
829 "description": "Sets the text for the browser action. Shows up in the to oltip if the browser action is visible, and in the menu item.", 829 "description": "Sets the title of the browser action. Shows up in the to oltip if the browser action is visible, and in the menu item.",
830 "parameters": [ 830 "parameters": [
831 {"type": "string", "name": "name", "description": "The string the brow ser action should display when moused over.", "optional": false} 831 {
832 "name": "details",
833 "type": "object",
834 "properties": {
835 "title": {
836 "type": "string",
837 "description": "The string the browser action should display whe n moused over."
838 }
839 }
840 }
832 ] 841 ]
833 }, 842 },
834 { 843 {
835 "name": "setIcon", 844 "name": "setIcon",
836 "type": "function", 845 "type": "function",
837 "description": "Sets the icon for the browser action. Can be up to about 22px square.", 846 "description": "Sets the icon for the browser action. The icon can be sp ecified either as the index of one of the icons that was pre-specified in the ma nifest, or as the pixel data from a Canvas element. Either the iconIndex or the imageData property must be specified.",
838 "parameters": [ 847 "parameters": [
839 { 848 {
840 "name": "iconId", 849 "name": "details",
841 "description": "An ImageData object from a canvas element, or a zero -based index into the |icons| vector specified in the manifest. This is useful t o represent different browser action states. Example: A GMail checker could hav e a 'new email' icon and a 'no unread email' icon.", 850 "type": "object",
842 "choices": [ 851 "properties": {
843 {"type": "integer", "minimum": 0}, 852 "imageData": {
844 { 853 "type": "any",
845 "type": "object", 854 "description": "Pixel data for an image. Must be an ImageData ob ject (eg from a <code>canvas</code> element).",
846 "properties": { 855 "optional": true
847 "width": {"type": "integer", "description": "The image's width ."}, 856 },
848 "height": {"type": "integer", "description": "The image's heig ht."}, 857 "iconIndex": {
849 "data": {"type": "any", "description": "The pixel data. Must b e a CanvasPixelArray, with 32 bits per pixel and size equal to 4*width*height."} 858 "type": "integer",
850 } 859 "minimum": 0,
860 "description": "The zero-based index into the |icons| vector spe cified in the manifest.",
861 "optional": true
851 } 862 }
852 ] 863 }
853 } 864 }
854 ] 865 ]
855 }, 866 },
856 { 867 {
857 "name": "setBadgeText", 868 "name": "setBadgeText",
858 "type": "function", 869 "type": "function",
859 "description": "Sets the badge text for the browser action. This is prin ted on top of the icon.", 870 "description": "Sets the badge text for the browser action. This is prin ted on top of the icon.",
860 "parameters": [ 871 "parameters": [
861 {"type": "string", "name": "text", "description": "Any number of chara cters can be passed, but only about four can fit in the space."} 872 {
873 "name": "details",
874 "type": "object",
875 "properties": {
876 "text": {
877 "type": "string",
878 "description": "Any number of characters can be passed, but only about four can fit in the space."
879 }
880 }
881 }
862 ] 882 ]
863 }, 883 },
864 { 884 {
865 "name": "setBadgeBackgroundColor", 885 "name": "setBadgeBackgroundColor",
866 "type": "function", 886 "type": "function",
867 "description": "Sets the background color for the badge.", 887 "description": "Sets the background color for the badge.",
868 "parameters": [ 888 "parameters": [
869 { 889 {
870 "type": "array", 890 "name": "details",
871 "name": "color", 891 "type": "object",
872 "description": "An array of four integers in the range [0,255] that make up the ARGB color for the bakground of the badge.", 892 "properties": {
873 "items": { 893 "color": {
874 "type": "integer", 894 "type": "array",
875 "minimum": 0, 895 "description": "An array of four integers in the range [0,255] t hat make up the ARGB color for the bakground of the badge.",
876 "maximum": 255 896 "items": {
877 }, 897 "type": "integer",
878 "minItems": 4, 898 "minimum": 0,
879 "maxItems": 4 899 "maximum": 255
900 },
901 "minItems": 4,
902 "maxItems": 4
903 }
904 }
880 } 905 }
881 ] 906 ]
882 } 907 }
883 ], 908 ],
884 "events": [ 909 "events": [
910 {
911 "name": "onClicked",
912 "type": "function",
913 "description": "Fired when a page action button is clicked.",
914 "parameters": [
915 {
916 "name": "tab",
917 "$ref": "Tab"
918 }
919 ]
920 }
885 ] 921 ]
886 }, 922 },
887 { 923 {
888 "namespace": "bookmarks", 924 "namespace": "bookmarks",
889 "types": [ 925 "types": [
890 { 926 {
891 "id": "BookmarkTreeNode", 927 "id": "BookmarkTreeNode",
892 "type": "object", 928 "type": "object",
893 "description": "A node in the bookmarks tree, which is either a bookmark or a folder. Child nodes are ordered within their parent.", 929 "description": "A node in the bookmarks tree, which is either a bookmark or a folder. Child nodes are ordered within their parent.",
894 "properties": { 930 "properties": {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 "type": "function", 1312 "type": "function",
1277 "description": "Logs a message during internal unit testing.", 1313 "description": "Logs a message during internal unit testing.",
1278 "parameters": [ 1314 "parameters": [
1279 {"type": "string", "name": "message"} 1315 {"type": "string", "name": "message"}
1280 ] 1316 ]
1281 } 1317 }
1282 ], 1318 ],
1283 "events": [] 1319 "events": []
1284 } 1320 }
1285 ] 1321 ]
OLDNEW
« no previous file with comments | « chrome/browser/views/browser_actions_container.cc ('k') | chrome/common/extensions/docs/browserAction.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698