// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// The type schemas for structured manifest items. Not actually a callable API.

[
  {
    "namespace": "manifestTypes",
    "description": "Schemas for structured manifest entries",
    "compiler_options": {
      "generate_error_messages": true
    },
    "types": [
      {
        "id": "ChromeSettingsOverrides",
        "type": "object",
        "description": "Chrome settings which can be overriden by an extension.",
        "properties": {
          "homepage": {
            "description": "New value for the homepage.",
            "optional": true,
            "type": "string"
          },
          "search_provider": {
            "type": "object",
            "description": "A search engine",
            "optional": true,
            "properties": {
              "name": {
                "type": "string",
                "optional": true,
                "description": "Name of the search engine displayed to user. This may only be omitted if <em>prepopulated_id</em> is set."
              },
              "keyword": {
                "type": "string",
                "optional": true,
                "description": "Omnibox keyword for the search engine. This may only be omitted if <em>prepopulated_id</em> is set."
              },
              "favicon_url": {
                "type": "string",
                "optional": true,
                "description": "An icon URL for the search engine. This may only be omitted if <em>prepopulated_id</em> is set."
              },
              "search_url": {
                "type": "string",
                "description": "An search URL used by the search engine."
              },
              "encoding": {
                "type": "string",
                "optional": true,
                "description": "Encoding of the search term. This may only be omitted if <em>prepopulated_id</em> is set."
              },
              "suggest_url": {
                "type": "string",
                "optional": true,
                "description": "If omitted, this engine does not support suggestions."
              },
              "image_url": {
                "type": "string",
                "optional": true,
                "description": "If omitted, this engine does not support image search."
              },
              "search_url_post_params": {
                "type": "string",
                "optional": true,
                "description": "The string of post parameters to search_url"
              },
              "suggest_url_post_params": {
                "type": "string",
                "optional": true,
                "description": "The string of post parameters to suggest_url"
              },
              "image_url_post_params": {
                "type": "string",
                "optional": true,
                "description": "The string of post parameters to image_url"
              },
              "alternate_urls": {
                "type": "array",
                "items": { "type": "string" },
                "optional": true,
                "description": "A list of URL patterns that can be used, in addition to |search_url|."
              },
              "prepopulated_id": {
                "type": "integer",
                "optional": true,
                "description": "An ID of the built-in search engine in Chrome."
              },
              "is_default": {
                "type": "boolean",
                "description": "Specifies if the search provider should be default."
              }
            }
          },
          "startup_pages": {
            "description": "An array of length one containing a URL to be used as the startup page.",
            "optional": true,
            "type": "array",
            "items": {"type": "string"}
          }
        }
      },
      {
        "id": "FileSystemProviderSource",
        "type": "string",
        "description": "For <code>\"file\"</code> the source is a file passed via <code>onLaunched</code> event. For <code>\"device\"</code> contents are fetched from an external device (eg. plugged via USB), without using <code>file_handlers</code>. Finally, for <code>\"network\"</code> source, contents should be fetched via network.",
        "enum": ["file", "device", "network"]
      },
      {
        "id": "FileSystemProviderCapabilities",
        "description": "Represents capabilities of a providing extension.",
        "optional": true,
        "type": "object",
        "properties": {
          "configurable": {
            "type": "boolean",
            "optional": true,
            "description": "Whether configuring via <code>onConfigureRequested</code> is supported. By default: <code>false</code>."
          },
          "multiple_mounts": {
            "type": "boolean",
            "optional": true,
            "description": "Whether multiple (more than one) mounted file systems are supported. By default: <code>false</code>."
          },
          "watchable": {
            "type": "boolean",
            "optional": true,
            "description": "Whether setting watchers and notifying about changes is supported. By default: <code>false</code>."
          },
          "source": {
            "$ref": "FileSystemProviderSource",
            "description": "Source of data for mounted file systems."
          }
        }
      }
    ]
  }
]
