// 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" ],
        "description": "Accessibility gestures fired by the touch exploration controller."
      }
    ],
    "functions": [
      {
        "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": "setFocusRing",
        "type": "function",
        "description": "Set the bounds of the accessibility focus ring.",
        "parameters": [
          {
            "name": "rects",
            "type": "array",
            "items": { "$ref": "ScreenRect" },
            "description": "Array of rectangles to draw the accessibility focus ring around."
          }
        ]
      },
      {
        "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."
          }
        ]
      }
    ],
    "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"
          }
        ]
      }
    ]
  }
]
