// Copyright (c) 2012 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": "systemPrivate",
    "description": "none",
    "types": [
      {
        "id": "UpdateStatusState",
        "type": "string",
        "enum": ["NotAvailable", "Updating", "NeedRestart"],
        "description": "State of system update.  NotAvailable when there is no available update or the update system is in error state, Updating when a system update is in progress, NeedRestart when a system update is finished and restart is needed."
      },
      {
        "id": "GetIncognitoModeAvailabilityValue",
        "type": "string",
        "enum": ["enabled", "disabled", "forced"],
        "description": "Exposes whether the incognito mode is available to windows. One of 'enabled', 'disabled' (user cannot browse pages in Incognito mode), 'forced' (all pages/sessions are forced into Incognito mode)."
      },
      {
        "id": "UpdateStatus",
        "type": "object",
        "description": "Information about the system update.",
        "properties": {
          "state": {
            "$ref": "UpdateStatusState",
            "description": "State of system update."
          },
          "downloadProgress": {
            "type": "number",
            "description": "Value between 0 and 1 describing the progress of system update download.  This value will be set to 0 when |state| is NotAvailable, 1 when NeedRestart."
          }
        }
      }
    ],
    "functions": [
      {
        "name": "getIncognitoModeAvailability",
        "type": "function",
        "description": "Returns whether the incognito mode is enabled, disabled or forced",
        "parameters": [
          {
            "name": "callback",
            "type": "function",
            "description": "Called with the result.",
            "parameters": [
              {
                "name": "value",
                "$ref": "GetIncognitoModeAvailabilityValue"
              }
            ]
          }
        ]
      },
      {
        "name": "getUpdateStatus",
        "type": "function",
        "description": "Gets information about the system update.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "$ref": "UpdateStatus",
                "name": "status",
                "description": "Details of the system update"
              }
            ]
          }
        ]
      },
      {
        "name": "getApiKey",
        "type": "function",
        "description": "Gets Chrome's API key to use for requests to Google services.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "key",
                "type": "string",
                "description": "The API key."
              }
            ]
          }
        ]
      }
    ]
  }
]
