Extract SIGPIPE ignoring code to a common place.
[chromium-blink-merge.git] / chrome / common / extensions / api / permissions.json
blob4f4b3626c98ee825ca6b977df2d88fddfa458613
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.
6   {
7     "namespace": "permissions",
8     "types": [
9       {
10         "id": "Permissions",
11         "type": "object",
12         "properties": {
13           "permissions": {
14             "type": "array",
15             "items": {"type": "string"},
16             "optional": true,
17             "description": "List of named permissions (does not include hosts or origins)."
18           },
19           "origins": {
20             "type": "array",
21             "items": {"type": "string"},
22             "optional": true,
23             "description": "List of origin permissions."
24           }
25         }
26       }
27     ],
28     "events": [
29       {
30         "name": "onAdded",
31         "type": "function",
32         "description": "Fired when the extension acquires new permissions.",
33         "parameters": [
34           {
35             "$ref": "Permissions",
36             "name": "permissions",
37             "description": "The newly acquired permissions."
38           }
39         ]
40       },
41       {
42         "name": "onRemoved",
43         "type": "function",
44         "description": "Fired when access to permissions has been removed from the extension.",
45         "parameters": [
46           {
47             "$ref": "Permissions",
48             "name": "permissions",
49             "description": "The permissions that have been removed."
50           }
51         ]
52       }
53      ],
54     "functions": [
55       {
56         "name": "getAll",
57         "type": "function",
58         "description": "Gets the extension's current set of permissions.",
59         "parameters": [
60           {
61             "name": "callback",
62             "type": "function",
63             "parameters": [
64                {
65                 "name": "permissions",
66                 "$ref": "Permissions",
67                 "description": "The extension's active permissions."
68               }
69             ]
70           }
71         ]
72       },
73       {
74         "name": "contains",
75         "type": "function",
76         "description": "Checks if the extension has the specified permissions.",
77         "parameters": [
78           {
79             "name": "permissions",
80             "$ref": "Permissions"
81           },
82           {
83             "name": "callback",
84             "type": "function",
85             "parameters": [
86               {
87                 "name": "result",
88                 "type": "boolean",
89                 "description": "True if the extension has the specified permissions."
90               }
91             ]
92           }
93         ]
94       },
95       {
96         "name": "request",
97         "type": "function",
98         "description": "Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will be set.",
99         "parameters": [
100           {
101             "name": "permissions",
102             "$ref": "Permissions"
103           },
104           {
105             "name": "callback",
106             "type": "function",
107             "optional": true,
108             "parameters": [
109               {
110                 "name": "granted",
111                 "type": "boolean",
112                 "description": "True if the user granted the specified permissions."
113               }
114             ]
115           }
116         ]
117       },
118       {
119         "name": "remove",
120         "type": "function",
121         "description": "Removes access to the specified permissions. If there are any problems removing the permissions, <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will be set.",
122         "parameters": [
123           {
124             "name": "permissions",
125             "$ref": "Permissions"
126           },
127           {
128             "name": "callback",
129             "type": "function",
130             "optional": true,
131             "parameters": [
132               {
133                 "name": "removed",
134                 "type": "boolean",
135                 "description": "True if the permissions were removed."
136               }
137             ]
138           }
139         ]
140       }
141     ]
142   }