chromium/chrome/common/extensions/api/wallpaper.json

// 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.

[
  {
    "namespace":"wallpaper",
    "compiler_options": {
      "implemented_in": "chrome/browser/chromeos/extensions/wallpaper_api.h"
    },
    "description": "Use the <code>chrome.wallpaper</code> API to change the ChromeOS wallpaper.",
    "platforms": ["chromeos", "lacros"],
    "types":
    [
      {
        "id": "WallpaperLayout",
        "type": "string",
        "enum": [ "STRETCH", "CENTER", "CENTER_CROPPED" ],
        "description": "The supported wallpaper layouts."
      }
    ],
    "functions": [
    {
      "name": "setWallpaper",
      "type": "function",
      "description": "Sets wallpaper to the image at <em>url</em> or <em>wallpaperData</em> with the specified <em>layout</em>",
      "platforms": ["chromeos", "lacros"],
      "parameters": [
        {
          "name": "details",
          "type": "object",
          "properties": {
            "data": {
              "type": "binary",
              "optional": true,
              "description": "The jpeg or png encoded wallpaper image as an ArrayBuffer."
            },
            "url": {
              "type": "string",
              "optional": true,
              "description": "The URL of the wallpaper to be set (can be relative)."
            },
            "layout": {
              "$ref": "WallpaperLayout",
              "description": "The supported wallpaper layouts."
            },
            "filename": {
              "type": "string",
              "description": "The file name of the saved wallpaper."
            },
            "thumbnail": {
              "type": "boolean",
              "optional": true,
              "description": "True if a 128x60 thumbnail should be generated. Layout and ratio are not supported yet."
            }
          }
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "type": "binary",
            "optional": true,
            "name": "thumbnail",
            "description": "The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60."
          }
        ]
      }
    }
    ]
  }
]