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

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

Issue 7480046: chrome.experimental.downloads stubs (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: DownloadDelta Created 9 years, 4 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 [ 1 [
2 { 2 {
3 "namespace": "extension", 3 "namespace": "extension",
4 "unprivileged": true, 4 "unprivileged": true,
5 "types": [ 5 "types": [
6 { 6 {
7 "id": "MessageSender", 7 "id": "MessageSender",
8 "type": "object", 8 "type": "object",
9 "description": "An object containing information about the script contex t that sent a message or request.", 9 "description": "An object containing information about the script contex t that sent a message or request.",
10 "properties": { 10 "properties": {
(...skipping 3665 matching lines...) Expand 10 before | Expand all | Expand 10 after
3676 "name": "onDrop", 3676 "name": "onDrop",
3677 "type": "function", 3677 "type": "function",
3678 "description": "Fired when the user drops bookmarks on the document", 3678 "description": "Fired when the user drops bookmarks on the document",
3679 "parameters": [ 3679 "parameters": [
3680 {"$ref": "BookmarkNodeData"} 3680 {"$ref": "BookmarkNodeData"}
3681 ] 3681 ]
3682 } 3682 }
3683 ] 3683 ]
3684 }, 3684 },
3685 { 3685 {
3686 "namespace": "experimental.downloads",
3687 "nodoc": "true",
3688 "events": [
3689 {
3690 "name": "onCreated",
3691 "type": "function",
3692 "unprivileged": true,
3693 "description": "This event fires with the DownloadItem object when a dow nload begins.",
3694 "parameters": [
3695 {"$ref": "DownloadItem"}
3696 ]
3697 },
3698 {
3699 "name": "onChanged",
3700 "type": "function",
3701 "unprivileged": true,
3702 "description": "When any of a DownloadItem's properties except
3703 |bytesReceived| changes, this event fires with the download id and an ob ject containing the properties that changed.",
3704 "parameters": [
3705 {"$ref": "DownloadDelta"}
3706 ]
3707 },
3708 {
3709 "name": "onErased",
3710 "type": "function",
3711 "unprivileged": true,
3712 "description": "Fires with the download id when a download is erased fro m history.",
3713 "parameters": [
3714 {"type": "integer", "name": "downloadId"}
3715 ]
3716 }
3717 ],
3718 "properties": {
3719 "STATE_IN_PROGRESS": {
3720 "type": "string",
3721 "value": "in_progress",
3722 "description": "The download is currently receiving data from the server ."
3723 },
3724 "STATE_INTERRUPTED": {
3725 "type": "string",
3726 "value": "interrupted",
3727 "description": "An error broke the connection with the file host."
3728 },
3729 "STATE_COMPLETE": {
3730 "type": "string",
3731 "value": "complete",
3732 "description": "The download has completed."
3733 },
3734 "DANGER_SAFE": {
3735 "type": "string",
3736 "value": "safe",
3737 "description": "The file has been determined to present no known danger to the user's computer."
3738 },
3739 "DANGER_FILE": {
3740 "type": "string",
3741 "value": "file",
3742 "description": "The download's filename is suspicious."
3743 },
3744 "DANGER_URL": {
3745 "type": "string",
3746 "value": "url",
3747 "description": "The download's URL is suspicious."
3748 }
3749 },
3750 "types": [
3751 {
3752 "id": "DownloadItem",
3753 "type": "object",
3754 "description": "The state of a file as it is downloaded from the interne t.",
3755 "properties": {
3756 "id": {
3757 "type": "integer",
3758 "description": "An identifier that is persistent across browser sess ions."
3759 },
3760 "url": {
3761 "type": "string",
3762 "description": "absolute URL"
3763 },
3764 "filename": {
3765 "type": "string",
3766 "description": "absolute local path"
3767 },
3768 "danger": {
3769 "type": "string",
3770 "description": "Indication of whether this download is thought to be safe or known to be suspicious.",
3771 "enum": ["safe", "file", "url"],
3772 "optional": true,
3773 },
3774 "dangerAccepted": {
3775 "type": "boolean",
3776 "description": "true if the user has accepted the download's danger. "
3777 },
3778 "mime": {
3779 "type": "string",
3780 "description": "The file's MIME type."
3781 },
3782 "startTime": {
3783 "type": "integer",
3784 "description": "Number of milliseconds between the unix epoch and wh en this download began."
3785 },
3786 "endTime": {
3787 "type": "integer",
3788 "description": "Number of milliseconds between the unix epoch and wh en this download ended."
3789 "optional": true,
3790 },
3791 "state": {
3792 "type": "string",
3793 "description": "Indicates whether the download is progressing, inter rupted, or complete.",
3794 "enum": ["in_progress", "complete", "interrupted"]
3795 },
3796 "paused": {
3797 "type": "boolean",
3798 "description": "true if the download has stopped reading data from t he host, but kept the connection open."
3799 },
3800 "error": {
3801 "type": "integer",
3802 "description": "Number indicating why a download was interrupted.",
3803 "optional": true
3804 },
3805 "bytesReceived": {
3806 "type": "integer",
3807 "description": "Number of bytes received so far from the host, witho ut considering file compression."
3808 },
3809 "totalBytes": {
3810 "type": "integer",
3811 "description": "Number of bytes in the whole file, without consideri ng file compression, or -1 if unknown."
3812 },
3813 "fileSize": {
3814 "type": "integer",
3815 "description": "Number of bytes in the whole file post-decompression , or -1 if unknown."
3816 }
3817 }
3818 },
3819 {
3820 "id": "DownloadOptions",
3821 "type": "object",
3822 "properties": {
3823 "url": {
3824 "type": "string",
3825 "description": "The URL to download.",
3826 "minLength": 1
3827 },
3828 "filename": {
3829 "type": "string",
3830 "description": "A file path relative to the Downloads directory to c ontain the downloaded file.",
3831 "optional": true
3832 },
3833 "saveAs": {
3834 "type": "boolean",
3835 "optional": true,
3836 "description": "Use a file-chooser to allow the user to select a fil ename."
3837 },
3838 "method": {
3839 "type": "string",
3840 "description": "The HTTP method to use if the URL uses the HTTP[S] p rotocol.",
3841 "optional": true,
3842 "enum": ["GET", "POST"]
3843 },
3844 "headers": {
3845 "$ref": "HttpHeaders",
3846 "description": "Extra HTTP headers to send with the request if the U RL uses the HTTP[s] protocol, restricted to those allowed by XMLHttpRequest.",
3847 "optional": true,
3848 },
3849 "body": {
3850 "type": "string",
3851 "description": "post body",
3852 "optional": true
3853 }
3854 }
3855 },
3856 {
3857 "id": "DownloadQuery",
3858 "type": "object",
3859 "description": "",
3860 "properties": {
3861 "query": {
3862 "type": "string",
3863 "description": "This space-separated string of search terms that may be grouped using quotation marks limits results to downloads whose filename or url contain all of the search terms that do not begin with a dash ‘-’ and none o f the search terms that do begin with a dash.",
3864 "optional": true
3865 },
3866 "startedBefore": {
3867 "type": "integer",
3868 "description": "Limits results to downloads that started before the given ms since the epoch.",
3869 "optional": true
3870 },
3871 "startedAfter": {
3872 "type": "integer",
3873 "description": "Limits results to downloads that started after the g iven ms since the epoch.",
3874 "optional": true
3875 },
3876 "endedBefore": {
3877 "type": "integer",
3878 "description": "Limits results to downloads that ended before the gi ven ms since the epoch.",
3879 "optional": true
3880 },
3881 "endedAfter": {
3882 "type": "integer",
3883 "description": "Limits results to downloads that ended after the giv en ms since the epoch.",
3884 "optional": true
3885 },
3886 "totalBytesGreater": {
3887 "type": "integer",
3888 "description": "Limits results to downloads whose totalBytes is grea ter than the given integer.",
3889 "optional": true
3890 },
3891 "totalBytesLess": {
3892 "type": "integer",
3893 "description": "Limits results to downloads whose totalBytes is less than the given integer.",
3894 "optional": true
3895 },
3896 "filenameRegex": {
3897 "type": "string",
3898 "description": "Limits results to downloads whose filename matches t he given regular expression.",
3899 "optional": true
3900 },
3901 "urlRegex": {
3902 "type": "string",
3903 "description": "Limits results to downloads whose url matches the gi ven regular expression.",
3904 "optional": true
3905 },
3906 "limit": {
3907 "type": "integer",
3908 "optional": true,
3909 "description": "Setting this integer limits the number of results. O therwise, all matching DownloadItems will be returned."
3910 },
3911 "orderBy": {
3912 "type": "string",
3913 "optional": true,
3914 "description": "Setting this string to a DownloadItem property sorts the DownloadItems prior to applying the above filters. For example, setting |or derBy|=”startTime” sorts the DownloadItems by their start time in ascending orde r. To specify descending order, prefix |orderBy| with a hyphen: “-startTime”."
3915 },
3916 "id": {
3917 "type": "integer",
3918 "optional": true,
3919 "description": "An identifier that is persistent across browser sess ions."
3920 },
3921 "url": {
3922 "type": "string",
3923 "optional": true,
3924 "description": "absolute URL"
3925 },
3926 "filename": {
3927 "type": "string",
3928 "optional": true,
3929 "description": "absolute local path"
3930 },
3931 "danger": {
3932 "type": "string",
3933 "description": "Indication of whether this download is thought to be safe or known to be suspicious.",
3934 "enum": ["safe", "file", "url"],
3935 "optional": true,
3936 },
3937 "dangerAccepted": {
3938 "type": "boolean",
3939 "optional": true,
3940 "description": "true if the user has accepted the download's danger. "
3941 },
3942 "mime": {
3943 "type": "string",
3944 "optional": true,
3945 "description": "The file's MIME type."
3946 },
3947 "startTime": {
3948 "type": "integer",
3949 "optional": true,
3950 "description": "Number of milliseconds between the unix epoch and wh en this download began."
3951 },
3952 "endTime": {
3953 "type": "integer",
3954 "description": "Number of milliseconds between the unix epoch and wh en this download ended."
3955 "optional": true,
3956 },
3957 "state": {
3958 "type": "string",
3959 "optional": true,
3960 "description": "Indicates whether the download is progressing, inter rupted, or complete.",
3961 "enum": ["in_progress", "complete", "interrupted"]
3962 },
3963 "paused": {
3964 "type": "boolean",
3965 "optional": true,
3966 "description": "true if the download has stopped reading data from t he host, but kept the connection open."
3967 },
3968 "error": {
3969 "type": "integer",
3970 "description": "Number indicating why a download was interrupted.",
3971 "optional": true
3972 },
3973 "bytesReceived": {
3974 "type": "integer",
3975 "optional": true,
3976 "description": "Number of bytes received so far from the host, witho ut considering file compression."
3977 },
3978 "totalBytes": {
3979 "type": "integer",
3980 "optional": true,
3981 "description": "Number of bytes in the whole file, without consideri ng file compression, or -1 if unknown."
3982 },
3983 "fileSize": {
3984 "type": "integer",
3985 "optional": true,
3986 "description": "Number of bytes in the whole file post-decompression , or -1 if unknown."
3987 }
3988 }
3989 },
3990 {
3991 "id": "DownloadBooleanDiff",
3992 "type": "object",
3993 "description": "Encapsulates a change in a boolean DownloadItem field.",
3994 "properties": {
3995 "old": {
3996 "type": "boolean",
3997 "optional": true
3998 },
3999 "new": {
4000 "type": "boolean",
4001 "optional": true
4002 }
4003 }
4004 },
4005 {
4006 "id": "DownloadIntegerDiff",
4007 "type": "object",
4008 "description": "Encapsulates a change in an integer DownloadItem field." ,
4009 "properties": {
4010 "old": {
4011 "type": "integer",
4012 "optional": true
4013 },
4014 "new": {
4015 "type": "integer",
4016 "optional": true
4017 }
4018 }
4019 },
4020 {
4021 "id": "DownloadStringDiff",
4022 "type": "object",
4023 "description": "Encapsulates a change in a string DownloadItem field.",
4024 "properties": {
4025 "old": {
4026 "type": "string",
4027 "optional": true
4028 },
4029 "new": {
4030 "type": "string",
4031 "optional": true
4032 }
4033 }
4034 },
4035 {
4036 "id": "DownloadDelta",
4037 "type": "object",
4038 "description": "Encapsulates a change in a DownloadItem.",
4039 "properties": {
4040 "id": {
4041 "type": "integer",
4042 "description": "An identifier that is persistent across browser sess ions."
4043 },
4044 "url": {
4045 "$ref": "DownloadStringDiff",
4046 "optional": true
4047 },
4048 "filename": {
4049 "$ref": "DownloadStringDiff",
4050 "optional": true
4051 },
4052 "danger": {
4053 "$ref": "DownloadStringDiff",
4054 "optional": true
4055 },
4056 "dangerAccepted": {
4057 "$ref": "DownloadBooleanDiff",
4058 "optional": true
4059 },
4060 "mime": {
4061 "$ref": "DownloadStringDiff",
4062 "optional": true
4063 },
4064 "startTime": {
4065 "$ref": "DownloadIntegerDiff",
4066 "optional": true
4067 },
4068 "endTime": {
4069 "$ref": "DownloadIntegerDiff",
4070 "optional": true
4071 },
4072 "state": {
4073 "$ref": "DownloadStringDiff",
4074 "optional": true
4075 },
4076 "paused": {
4077 "$ref": "DownloadBooleanDiff",
4078 "optional": true
4079 },
4080 "error": {
4081 "$ref": "DownloadIntegerDiff",
4082 "optional": true
4083 },
4084 "bytesReceived": {
4085 "$ref": "DownloadIntegerDiff",
4086 "optional": true
4087 },
4088 "totalBytes": {
4089 "$ref": "DownloadIntegerDiff",
4090 "optional": true
4091 },
4092 "fileSize": {
4093 "$ref": "DownloadIntegerDiff",
4094 "optional": true
4095 }
4096 }
4097 },
4098 {
4099 "id": "DownloadResponse",
4100 "type": "object",
4101 "nodoc": true,
4102 "description": "This object is transformed into two callback parameters for the callback to download().",
4103 "properties": {
4104 "id": {"type": "integer", "optional": true},
4105 "error": {"type": "integer", "optional": true}
4106 }
4107 }
4108 ],
4109 "functions": [
4110 {
4111 "name": "download",
4112 "type": "function",
4113 "description": "Download a URL. If the URL uses the HTTP[S] protocol, th en the request will include all cookies currently set for its hostname. If the d ownload started successfully, |callback| will be called with the new DownloadIte m’s |id| and |error|=undefined. If there was an error starting the download, the n |callback| will be called with |downloadId|=undefined and an |error| code inte ger. If the URL’s hostname is not specified in the |permissions| section of the extension’s manifest, then the |error| object will indicate that the extension d oes not have permission to access that hostname.",
4114 "parameters": [
4115 {"$ref": "DownloadOptions"},
4116 {
4117 "name": "callback",
4118 "type": "function",
4119 "optional": true,
4120 "parameters": [
4121 {"$ref": "DownloadResponse"}
4122 ]
4123 }
4124 ]
4125 },
4126 {
4127 "name": "search",
4128 "type": "function",
4129 "description": "Find DownloadItems. Set |query| to the empty object to g et all DownloadItems. To get a specific DownloadItem, set only the |id| field.",
4130 "parameters": [
4131 {"$ref": "DownloadQuery"},
4132 {
4133 "name": "callback",
4134 "type": "function",
4135 "optional": true,
4136 "parameters": [
4137 {"name": "items", "type": "array"}
4138 ]
4139 }
4140 ]
4141 },
4142 {
4143 "name": "erase",
4144 "type": "function",
4145 "description": "Erase matching DownloadItems from history",
4146 "parameters": [
4147 {"$ref": "DownloadQuery"},
4148 {
4149 "name": "callback",
4150 "type": "function",
4151 "optional": true,
4152 "parameters": [
4153 {"name": "ids", "type": "array"}
4154 ]
4155 }
4156 ]
4157 },
4158 {
4159 "name": "setDestination",
4160 "type": "function",
4161 "description": "Move the file to Downloads/relativePath instead of the D ownloads directory if it has completed and pass true to callback. If |relativePa th| specifies a directory that does not exist then it will be created. If it has not completed, store |relativePath| such that the file will be moved there when it completes and pass true to callback without waiting for the download to comp lete. Does nothing if the download is cancelled or if |downloadId| does not refe rence an existing DownloadItem, but pass false to callback. If the file could no t be moved, then the DownloadItem will transition to STATE_INTERRUPTED, its |err or| property will be set accordingly, false will be passed to callback, and the OnChanged event will fire.",
4162 "parameters": [
4163 {"name": "id", "type": "integer"},
4164 {"name": "relativePath", "type": "string"}
4165 ]
4166 },
4167 {
4168 "name": "acceptDanger",
4169 "type": "function",
4170 "description": "Accept a dangerous download. If a download is dangerous, then it will not transition to the completed state until this function is calle d.",
4171 "parameters": [
4172 {"name": "id", "type": "integer"}
4173 ]
4174 },
4175 {
4176 "name": "show",
4177 "type": "function",
4178 "description": "Show the downloaded file in its folder.",
4179 "parameters": [
4180 {"name": "id", "type": "integer"}
4181 ]
4182 },
4183 {
4184 "name": "drag",
4185 "type": "function",
4186 "description": "Drag the file to another application",
4187 "parameters": [
4188 {"name": "id", "type": "integer"}
4189 ]
4190 },
4191 {
4192 "name": "pause",
4193 "type": "function",
4194 "description": "Pause the download.",
4195 "parameters": [
4196 {"name": "id", "type": "integer"}
4197 ]
4198 },
4199 {
4200 "name": "resume",
4201 "type": "function",
4202 "description": "Resume a paused download.",
4203 "parameters": [
4204 {"name": "id", "type": "integer"}
4205 ]
4206 },
4207 {
4208 "name": "cancel",
4209 "type": "function",
4210 "description": "Cancel a download.",
4211 "parameters": [
4212 {"name": "id", "type": "integer"}
4213 ]
4214 }
4215 ]
4216 },
4217 {
3686 "namespace": "devtools", 4218 "namespace": "devtools",
3687 "nodoc": "true", 4219 "nodoc": "true",
3688 "types": [], 4220 "types": [],
3689 "functions": [ 4221 "functions": [
3690 { 4222 {
3691 "name": "getTabEvents", 4223 "name": "getTabEvents",
3692 "type": "function", 4224 "type": "function",
3693 "description": "Experimental support for timeline API", 4225 "description": "Experimental support for timeline API",
3694 "nodoc": "true", 4226 "nodoc": "true",
3695 "parameters": [ 4227 "parameters": [
(...skipping 3652 matching lines...) Expand 10 before | Expand all | Expand 10 after
7348 "description": "A string result code. The value is non-empty on success only in tests.", 7880 "description": "A string result code. The value is non-empty on success only in tests.",
7349 "optional": "true" 7881 "optional": "true"
7350 } 7882 }
7351 ] 7883 ]
7352 } 7884 }
7353 ] 7885 ]
7354 } 7886 }
7355 ] 7887 ]
7356 } 7888 }
7357 ] 7889 ]
OLDNEW
« chrome/browser/extensions/extension_downloads_api_constants.cc ('K') | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698