Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / common / api / virtual_keyboard_private.json
blob105a126341f4b59a1b7216aa423d4f2bb83162fd
1 // Copyright 2013 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": "virtualKeyboardPrivate",
8     "compiler_options": {
9       "implemented_in": "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h"
10     },
11     "platforms": ["chromeos"],
12     "description": "none",
13     "types": [
14       {
15         "id": "VirtualKeyboardEventType",
16         "type": "string",
17         "description": "One of keyup or keydown.",
18         "enum": ["keyup", "keydown"]
19       },
20       {
21         "id": "VirtualKeyboardEvent",
22         "type": "object",
23         "properties": {
24           "type": {"$ref": "VirtualKeyboardEventType"},
25           "charValue": {"type": "integer", "description": "Unicode value of the key."},
26           "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
27           "keyName": {"type": "string", "description": "Name of the key, which is independent of modifier state."},
28           "modifiers": {"type": "integer", "optional": true, "description": "Flag for modifiers that are active. None = 0, Shift = 2, Control = 4, Alt = 8."}
29         }
30       },
31       {
32         "id": "KeyboardMode",
33         "type": "string",
34         "enum": [ "FULL_WIDTH", "FLOATING" ],
35         "description": "The value of the virtual keyboard mode to set to."
36       },
37       {
38         "id": "OnTextInputBoxFocusedType",
39         "type": "string",
40         "description": "The value of type attribute of the focused text input box.",
41         "enum": ["text", "number", "password", "date", "url", "tel", "email"]
42       },
43       {
44         "id": "Bounds",
45         "type": "object",
46         "properties": {
47           "left": {"type": "integer", "description": "The position of the virtual keyboard window's left edge."},
48           "top": {"type": "integer", "description": "The position of the virtual keyboard window's top edge."},
49           "width": {"type": "integer", "description": "The width of the virtual keyboard window."},
50           "height": {"type": "integer", "description": "The height of the virtual keyboard window."}
51         }
52       }
53     ],
54     "functions": [
55       {
56         "name": "insertText",
57         "type": "function",
58         "description": "Inserts text into the currently focused text field.",
59         "parameters": [
60           { "name": "text",
61             "type": "string",
62             "description": "The text that will be inserted."
63           },
64           { "type": "function",
65             "name": "callback",
66             "optional": true,
67             "description": "Called when the insertion is completed.",
68             "parameters": []
69           }
70         ]
71       },
72       {
73         "name": "sendKeyEvent",
74         "type": "function",
75         "description": "Sends a fabricated key event to the focused input field.",
76         "parameters": [
77           { "name": "keyEvent",
78             "$ref": "VirtualKeyboardEvent",
79             "description": ""
80           },
81           { "name": "callback",
82             "type": "function",
83             "optional": true,
84             "description": "Called after processing the event.",
85             "parameters": []
86           }
87         ]
88       },
89       {
90         "name": "hideKeyboard",
91         "type": "function",
92         "description": "Hides the virtual keyboard.",
93         "parameters": [
94           { "type": "function",
95             "name": "callback",
96             "optional": true,
97             "description": "Called when the keyboard is hidden.",
98             "parameters": []
99           }
100         ]
101       },
102       {
103         "name": "lockKeyboard",
104         "type": "function",
105         "description": "Sets the lock state of the virtual keyboard. A locked keyboard remains visible even after a text area loses input focus.",
106         "parameters": [
107           {
108             "type": "boolean",
109             "name": "lock"
110           }
111         ]
112       },
113       {
114         "name": "keyboardLoaded",
115         "type": "function",
116         "description": "Inform the system that the keyboard has loaded.",
117         "parameters": [
118           { "type": "function",
119             "name": "callback",
120             "optional": true,
121             "description": "Called when load acknowledgement is complete.",
122             "parameters": []
123           }
124         ]
125       },
126       {
127         "name": "getKeyboardConfig",
128         "type": "function",
129         "description": "Gets the virtual keyboard configuration.",
130         "parameters": [
131           {
132             "type": "function",
133             "name": "callback",
134             "optional": true,
135             "description": "Called when querying virtual keyboard configuration is complete.",
136             "parameters": [
137               {
138                 "type": "object",
139                 "name": "config",
140                 "properties": {
141                   "layout": {
142                     "type": "string",
143                     "minLength": 1,
144                     "description": "Virtual keyboard layout string."
145                   },
146                   "a11ymode": {
147                     "type": "boolean",
148                     "description": "True if accessibility virtual keyboard is enabled."
149                   },
150                   "features": {
151                     "type": "array",
152                     "items": { "type": "string" },
153                     "description": "List of experimental feature flags."
154                   }
155                 }
156               }
157             ]
158           }
159         ]
160       },
161       {
162         "name": "openSettings",
163         "type": "function",
164         "description": "Opens chrome://settings/languages page.",
165         "parameters": [
166         ]
167       },
168       {
169         "name": "setMode",
170         "type": "function",
171         "description": "Sets the virtual keyboard mode.",
172         "parameters": [
173           {
174             "$ref": "KeyboardMode",
175             "name": "mode",
176             "description": "The value of the virtual keyboard mode to set to."
177           }
178         ]
179       }
181     ],
182     "events": [
183       {
184         "name": "onTextInputBoxFocused",
185         "type": "function",
186         "description": "This event is sent when focus enters a text input box.",
187         "parameters": [
188           {
189             "type": "object",
190             "name": "context",
191             "description": "Describes the text input box that has acquired focus. Note only the type of text input box is passed. This API is intended to be used by non-ime virtual keyboard only. Normal ime virtual keyboard should use chrome.input.ime.onFocus to get the more detailed InputContext.",
192             "properties": {
193               "type": {
194                 "$ref": "OnTextInputBoxFocusedType",
195                 "description": "The value of type attribute of the focused text input box."
196               }
197             }
198           }
199         ]
200       },
201       {
202         "name": "onBoundsChanged",
203         "type": "function",
204         "description": "This event is sent when virtual keyboard bounds changed and overscroll/resize is enabled.",
205         "parameters": [
206           {
207             "name": "bounds",
208             "description": "The virtual keyboard bounds",
209             "$ref": "Bounds"
210           }
211         ]
212       }
213     ]
214   }