summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/common/extensions/api/accessibility_private.json
blob: b277a46e34659cf71723a4546e28c547794112ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "accessibilityPrivate",
    "compiler_options": {
      "implemented_in": "chrome/browser/accessibility/accessibility_extension_api.h"
    },
    "description": "none",
    "types": [
      {
        "id": "AlertInfo",
        "type": "object",
        "description": "Information about an alert",
        "properties": {
          "message": {
            "type": "string",
            "description": "The message the alert is showing."
          }
        }
      },
      {
        "id": "ScreenRect",
        "type": "object",
        "description": "Bounding rectangle in global screen coordinates.",
        "properties": {
          "left": {"type": "integer", "description": "Left coordinate in global screen coordinates."},
          "top": {"type": "integer", "description": "Top coordinate in global screen coordinates."},
          "width": {"type": "integer", "description": "Width in pixels."},
          "height": {"type": "integer", "description": "Height in pixels."}
        }
      },
      {
        "id": "Gesture",
        "type": "string",
        "enum": [ "click", "swipeLeft1", "swipeUp1", "swipeRight1", "swipeDown1", "swipeLeft2", "swipeUp2", "swipeRight2", "swipeDown2", "swipeLeft3", "swipeUp3", "swipeRight3", "swipeDown3", "swipeLeft4", "swipeUp4", "swipeRight4", "swipeDown4", "tap2", "tap3", "tap4" ],
        "description": "Accessibility gestures fired by the touch exploration controller."
      },
      {
        "id": "SwitchAccessCommand",
        "type": "string",
        "enum": [ "select", "next", "previous" ],
        "description": "Commands that can be triggered by switch activation."
      },
      {
        "id": "SyntheticKeyboardEventType",
        "type": "string",
        "description": "The event to send",
        "enum": ["keyup", "keydown"]
      },
      {
        "id": "SyntheticKeyboardModifiers",
        "type": "object",
        "properties": {
          "ctrl": {
            "type": "boolean",
            "description": "Control modifier.",
            "optional": true
          },
          "alt": {
            "type": "boolean",
            "description": "alt modifier.",
            "optional": true
          },
          "search": {
            "type": "boolean",
            "description": "search modifier.",
            "optional": true
          },
          "shift": {
            "type": "boolean",
            "description": "shift modifier.",
            "optional": true
          }
        }
      },
      {
        "id": "SyntheticKeyboardEvent",
        "type": "object",
        "properties": {
          "type": {"$ref": "SyntheticKeyboardEventType"},
          "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
          "modifiers": {
            "$ref": "SyntheticKeyboardModifiers",
            "optional": true,
            "description": "Contains all active modifiers."
          }
        }
      },
      {
        "id": "SyntheticMouseEventType",
        "type": "string",
        "description": "The type of event to send",
        "enum": ["press", "release", "drag", "move", "enter", "exit"]
      },
      {
        "id": "SyntheticMouseEvent",
        "type": "object",
        "properties": {
          "type": {"$ref": "SyntheticMouseEventType"},
          "x": {"type": "integer", "description": "X coordinate for mouse event in global screen coordinates"},
          "y": {"type": "integer", "description": "Y coordinate for mouse event in global screen coordinates"}
        }
      },
      {
        "id": "SelectToSpeakState",
        "type": "string",
        "description": "The state of the Select-to-Speak extension",
        "enum": ["selecting", "speaking", "inactive"]
      },
      {
        "id": "FocusType",
        "type": "string",
        "description": "The type of visual appearance for the focus ring.",
        "enum": ["glow", "solid", "dashed"]
      },
      {
        "id": "FocusRingInfo",
        "type": "object",
        "properties": {
          "rects": {
            "type": "array",
            "items": { "$ref": "ScreenRect" },
            "description": "Array of rectangles to draw the accessibility focus ring around."
          },
          "type": {
            "$ref": "FocusType",
            "description": "The FocusType for the ring."
          },
          "color": {
            "type": "string",
            "description": "A CSS-style color string (e.g. #3F8213) that describes the primary color of the focus ring."
          },
          "secondaryColor": {
            "type": "string",
            "description": "A CSS-style color string (e.g. #3F82E4) that describes the secondary color of the focus ring, if there is one.",
            "optional": true
          },
          "id": {
            "type": "string",
            "description": "An identifier for this focus ring, unique within the extension.",
            "optional": true
          }
        }
      }
    ],
    "functions": [
      {
        "name": "getDisplayLanguage",
        "type": "function",
        "nocompile": true,
        "description": "Called to translate languageCodeToTranslate into human-readable string in the language specified by targetLanguageCode",
        "parameters": [
          {
            "name": "languageCodeToTranslate",
            "type": "string"
          },
          {
            "name": "targetLanguageCode",
            "type": "string"
          }
        ],
        "returns": {
          "type": "string",
          "description": "The human-readable language string in the provided language."
        },
        "platforms": ["chromeos"]
      },
      {
        "name": "getBatteryDescription",
        "type": "function",
        "description": "Called to request battery status from Chrome OS system.",
        "parameters": [
          {
            "name": "callback",
            "type": "function",
            "description": "Returns battery description as a string.",
            "parameters": [
              {
                "name": "batteryDescription",
                "type": "string"
              }
            ]
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "setNativeAccessibilityEnabled",
        "type": "function",
        "description": "Enables or disables native accessibility support. Once disabled, it is up to the calling extension to provide accessibility for web contents.",
        "parameters": [
          {
            "type": "boolean",
            "name": "enabled",
            "description": "True if native accessibility support should be enabled."
          }
        ]
      },
      {
        "name": "setFocusRings",
        "type": "function",
        "description": "Sets the given accessibility focus rings for this extension.",
        "parameters": [
          {
            "name": "focusRings",
            "type": "array",
            "items": { "$ref": "FocusRingInfo" },
            "description": "Array of focus rings to draw."
          }
        ]
      },
      {
        "name": "setHighlights",
        "type": "function",
        "description": "Sets the bounds of the accessibility highlight.",
        "parameters": [
          {
            "name": "rects",
            "type": "array",
            "items": { "$ref": "ScreenRect" },
            "description": "Array of rectangles to draw the highlight around."
          },
          {
            "name": "color",
            "type": "string",
            "description": "CSS-style hex color string beginning with # like #FF9982 or #EEE."
          }
        ]
      },
      {
        "name": "setKeyboardListener",
        "type": "function",
        "description": "Sets the calling extension as a listener of all keyboard events optionally allowing the calling extension to capture/swallow the key event via DOM apis. Returns false via callback when unable to set the listener.",
        "parameters": [
          {
            "type": "boolean",
            "name": "enabled",
            "description": "True if the caller wants to listen to key events; false to stop listening to events. Note that there is only ever one extension listening to key events."
          },
          {
            "type": "boolean",

            "name": "capture",
            "description": "True if key events should be swallowed natively and not propagated if preventDefault() gets called by the extension's background page."
          }
        ]
      },
      {
        "name": "darkenScreen",
        "type": "function",
        "description": "Darkens or undarkens the screen.",
        "parameters": [
          {
            "type": "boolean",
            "name": "enabled",
            "description": "True to darken screen; false to undarken screen."
          }
        ]
      },
      {
            "name": "setSwitchAccessMenuState",
            "type": "function",
            "description": "Shows or hides the Switch Access menu. If shown, it is at the indicated location.",
            "parameters": [
              {
                "name": "show",
                "type": "boolean",
                "description": "If true, show the menu. If false, hide the menu."
              },
              {
                "name": "element_bounds",
                "$ref": "ScreenRect",
                "description": "Position of an element, in global screen coordinates, to place the menu next to."
              },
              {
                "name": "item_count",
                "type": "integer",
                "description": "The number of items that need to be shown in the menu."
              }
            ],
            "platforms": ["chromeos"]
      },
      {
        "name": "forwardKeyEventsToSwitchAccess",
        "type": "function",
        "description": "When enabled, forwards key events to the Switch Access extension",
        "parameters": [
          {
            "name": "shouldForward",
            "type": "boolean"
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "setNativeChromeVoxArcSupportForCurrentApp",
        "type": "function",
        "description": "Sets current ARC app to use native ARC support.",
        "parameters": [
          {
            "name": "enabled",
            "type": "boolean",
            "description": "True for ChromeVox (native), false for TalkBack."
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "sendSyntheticKeyEvent",
        "type": "function",
        "description": "Sends a fabricated key event.",
        "parameters": [
          {
            "name": "keyEvent",
            "$ref": "SyntheticKeyboardEvent",
            "description": "The event to send."
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "enableChromeVoxMouseEvents",
        "type": "function",
        "description": "Enables or disables mouse events in ChromeVox.",
        "parameters": [
          {
            "name": "enabled",
            "type": "boolean",
            "description": "True if ChromeVox should receive mouse events."
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "sendSyntheticMouseEvent",
        "type": "function",
        "description": "Sends a fabricated mouse event.",
        "parameters": [
          {
            "name": "mouseEvent",
            "$ref": "SyntheticMouseEvent",
            "description": "The event to send."
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "onSelectToSpeakStateChanged",
        "type": "function",
        "description": "Called by the Select-to-Speak extension when Select-to-Speak has changed states, between selecting with the mouse, speaking, and inactive.",
        "parameters": [
          {
            "name": "state",
            "$ref": "SelectToSpeakState"
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "onScrollableBoundsForPointFound",
        "type": "function",
        "description": "Called by the Autoclick extension when findScrollableBoundsForPoint has found a scrolling container. |rect| will be the bounds of the nearest scrollable ancestor of the node at the point requested using findScrollableBoundsForPoint.",
        "parameters": [
          {
            "name": "rect",
            "$ref": "ScreenRect"
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "toggleDictation",
        "type": "function",
        "description": "Toggles dictation between active and inactive states.",
        "parameters": [],
        "platforms": ["chromeos"]
      },
      {
        "name": "setVirtualKeyboardVisible",
        "type": "function",
        "description": "Shows or hides the virtual keyboard.",
        "parameters": [
          {
            "name": "isVisible",
            "type": "boolean"
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "openSettingsSubpage",
        "type": "function",
        "description": "Opens a specified settings subpage. To open a page with url chrome://settings/manageAccessibility/tts, pass in the substring 'manageAccessibility/tts'.",
        "parameters": [
          {
            "name": "subpage",
            "type": "string"
          }
        ],
        "platforms": ["chromeos"]
      }
    ],
    "events": [
      {
        "name": "onIntroduceChromeVox",
        "type": "function",
        "description": "Fired whenever ChromeVox should output introduction."
      },
      {
        "name": "onAccessibilityGesture",
        "type": "function",
        "description": "Fired when an accessibility gesture is detected by the touch exploration controller.",
        "parameters": [
          {
            "name": "gesture",
            "$ref": "Gesture"
          }
        ]
      },
      {
        "name": "onTwoFingerTouchStart",
        "type": "function",
        "description": "Fired when we first detect two fingers are held down, which can be used to toggle spoken feedback on some touch-only devices.",
        "parameters": []
      },
      {
        "name": "onTwoFingerTouchStop",
        "type": "function",
        "description": "Fired when the user is no longer holding down two fingers (including releasing one, holding down three, or moving them).",
        "parameters": []
      },
      {
        "name": "onSelectToSpeakStateChangeRequested",
        "type": "function",
        "description": "Called when Chrome OS wants to change the Select-to-Speak state, between selecting with the mouse, speaking, and inactive.",
        "parameters": [],
        "platforms": ["chromeos"]
      },
      {
        "name": "onSwitchAccessCommand",
        "type": "function",
        "description": "Called when Chrome OS has received a key event corresponding to a Switch Access command.",
        "parameters": [
          {
            "name": "command",
            "$ref": "SwitchAccessCommand"
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "onAnnounceForAccessibility",
        "type": "function",
        "description": "Called when an internal component within accessibility wants to force speech output for an accessibility extension. Do not use without approval from accessibility owners.",
        "parameters": [
          {
            "name": "announceText",
            "type": "array",
            "items": { "type": "string" },
            "description": "Text to be announced."
          }
        ],
        "platforms": ["chromeos"]
      },
      {
        "name": "findScrollableBoundsForPoint",
        "type": "function",
        "description": "Called when an internal component within accessibility wants to find the nearest scrolling container at a given screen coordinate. Used in Automatic Clicks.",
        "parameters": [
          {
            "name": "x",
            "type": "number",
            "description": "X screen coordinate of the point."
          },
          {
            "name": "y",
            "type": "number",
            "description": "Y screen coordinate of the point."
          }
        ],
        "platforms": ["chromeos"]
      }
    ]
  }
]