Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / types.json
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.
4
5 [
6   {
7     "namespace": "types",
8     "description": "The <code>chrome.types</code> API contains type declarations for Chrome.",
9     "types": [
10       {
11         "id": "ChromeSetting",
12         "type": "object",
13         "js_module": "ChromeSetting",
14         "customBindings": "ChromeSetting",
15         "description": "An interface that allows access to a Chrome browser setting. See $(ref:accessibilityFeatures) for an example.",
16         "functions": [
17           {
18             "name": "get",
19             "type": "function",
20             "nocompile": true,
21             "description": "Gets the value of a setting.",
22             "parameters": [
23               {
24                 "name": "details",
25                 "type": "object",
26                 "description": "Which setting to consider.",
27                 "properties": {
28                   "incognito": {
29                     "type": "boolean",
30                     "optional": true,
31                     "description": "Whether to return the value that applies to the incognito session (default false)."
32                   }
33                 }
34               },
35               {
36                 "name": "callback",
37                 "type": "function",
38                 "parameters": [
39                   {
40                     "name": "details",
41                     "type": "object",
42                     "description": "Details of the currently effective value.",
43                     "properties": {
44                       "value": {
45                         "description": "The value of the setting.",
46                         "type": "any"
47                       },
48                       "levelOfControl": {
49                         "description": "One of<ul><li><var>not_controllable</var>: cannot be controlled by any extension</li><li><var>controlled_by_other_extensions</var>: controlled by extensions with higher precedence</li><li><var>controllable_by_this_extension</var>: can be controlled by this extension</li><li><var>controlled_by_this_extension</var>: controlled by this extension</li></ul>",
50                         "type": "string",
51                         "enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"]
52                       },
53                       "incognitoSpecific": {
54                         "description": "Whether the effective value is specific to the incognito session.<br/>This property will <em>only</em> be present if the <var>incognito</var> property in the <var>details</var> parameter of <code>get()</code> was true.",
55                         "type": "boolean",
56                         "optional": true
57                       }
58                     }
59                   }
60                 ]
61               }
62             ]
63           },
64           {
65             "name": "set",
66             "type": "function",
67             "nocompile": true,
68             "description": "Sets the value of a setting.",
69             "parameters": [
70               {
71                 "name": "details",
72                 "type": "object",
73                 "description": "Which setting to change.",
74                 "properties": {
75                   "value": {
76                     "description": "The value of the setting. <br/>Note that every setting has a specific value type, which is described together with the setting. An extension should <em>not</em> set a value of a different type.",
77                     "type": "any"
78                   },
79                   "scope": {
80                     "type": "string",
81                     "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"],
82                     "optional": true,
83                     "description": "Where to set the setting (default: regular). One of<ul><li><var>regular</var>: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),</li><li><var>regular_only</var>: setting for the regular profile only (not inherited by the incognito profile),</li><li><var>incognito_persistent</var>: setting for the incognito profile that survives browser restarts (overrides regular preferences),</li><li><var>incognito_session_only</var>: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).</li></ul>"
84                   }
85                 }
86               },
87               {
88                 "name": "callback",
89                 "type": "function",
90                 "description": "Called at the completion of the set operation.",
91                 "optional": true,
92                 "parameters": []
93               }
94             ]
95           },
96           {
97             "name": "clear",
98             "type": "function",
99             "nocompile": true,
100             "description": "Clears the setting, restoring any default value.",
101             "parameters": [
102               {
103                 "name": "details",
104                 "type": "object",
105                 "description": "Which setting to clear.",
106                 "properties": {
107                   "scope": {
108                     "type": "string",
109                     "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"],
110                     "optional": true,
111                     "description": "Where to clear the setting (default: regular). One of<ul><li><var>regular</var>: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),</li><li><var>regular_only</var>: setting for the regular profile only (not inherited by the incognito profile),</li><li><var>incognito_persistent</var>: setting for the incognito profile that survives browser restarts (overrides regular preferences),</li><li><var>incognito_session_only</var>: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).</li></ul>"
112                   }
113                 }
114               },
115               {
116                 "name": "callback",
117                 "type": "function",
118                 "description": "Called at the completion of the clear operation.",
119                 "optional": true,
120                 "parameters": []
121               }
122             ]
123           }
124         ],
125         "events": [
126           {
127             "name": "onChange",
128             "description": "Fired after the setting changes.",
129             "parameters": [
130               {
131                 "type": "object",
132                 "name": "details",
133                 "properties": {
134                   "value": {
135                     "description": "The value of the setting after the change.",
136                     "type": "any"
137                   },
138                   "levelOfControl": {
139                     "description": "One of<ul><li><var>not_controllable</var>: cannot be controlled by any extension</li><li><var>controlled_by_other_extensions</var>: controlled by extensions with higher precedence</li><li><var>controllable_by_this_extension</var>: can be controlled by this extension</li><li><var>controlled_by_this_extension</var>: controlled by this extension</li></ul>",
140                     "type": "string",
141                     "enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"]
142                   },
143                   "incognitoSpecific": {
144                     "description": "Whether the value that has changed is specific to the incognito session.<br/>This property will <em>only</em> be present if the user has enabled the extension in incognito mode.",
145                     "type": "boolean",
146                     "optional": true
147                   }
148                 }
149               }
150             ]
151           }
152         ]
153       }
154     ]
155   }
156 ]