1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 [ 6 { 7 "namespace":"wallpaperPrivate", 8 "compiler_options": { 9 "implemented_in": "chrome/browser/chromeos/extensions/wallpaper_private_api.h" 10 }, 11 "platforms": ["chromeos"], 12 "description": "none", 13 "types": [ 14 { 15 "id": "WallpaperLayout", 16 "type": "string", 17 "enum": [ "STRETCH", "CENTER", "CENTER_CROPPED" ] 18 } 19 ], 20 "functions": [ 21 { 22 "name": "getStrings", 23 "type": "function", 24 "description": "Gets translated strings and initialization data.", 25 "nodoc": "true", 26 "parameters": [ 27 { 28 "type": "function", 29 "name": "callback", 30 "parameters": [ 31 { 32 "name": "result", 33 "type": "object", 34 "additionalProperties": {"type": "any"} 35 } 36 ] 37 } 38 ] 39 }, 40 { 41 "name": "setWallpaperIfExists", 42 "type": "function", 43 "description": "Sets wallpaper if it exists in the local file system with specified layout", 44 "nodoc": "true", 45 "parameters": [ 46 { 47 "type": "string", 48 "name": "url" 49 }, 50 { 51 "name": "layout", 52 "$ref": "WallpaperLayout" 53 }, 54 { 55 "type": "function", 56 "name": "callback", 57 "parameters": [ 58 { 59 "type": "boolean", 60 "name": "exists" 61 } 62 ] 63 } 64 ] 65 }, 66 { 67 "name": "setWallpaper", 68 "type": "function", 69 "description": "Sets wallpaper to the image from url with specified layout", 70 "nodoc": "true", 71 "parameters": [ 72 { 73 "type": "binary", 74 "name": "wallpaper" 75 }, 76 { 77 "name": "layout", 78 "$ref": "WallpaperLayout" 79 }, 80 { 81 "type": "string", 82 "name": "url" 83 }, 84 { 85 "type": "function", 86 "name": "callback", 87 "parameters": [] 88 } 89 ] 90 }, 91 { 92 "name": "resetWallpaper", 93 "type": "function", 94 "description": "Clears current user's active custom wallpaper and changes to default wallpaper.", 95 "nodoc": "true", 96 "parameters": [] 97 }, 98 { 99 "name": "setCustomWallpaper", 100 "type": "function", 101 "description": "Sets wallpaper to the image from local file with specified layout and returns thumbnail if needed.", 102 "nodoc": "true", 103 "parameters": [ 104 { 105 "type": "binary", 106 "name": "wallpaper" 107 }, 108 { 109 "name": "layout", 110 "$ref": "WallpaperLayout" 111 }, 112 { 113 "type": "boolean", 114 "name": "generateThumbnail", 115 "description": "If true, callback should have a binary thumbnail." 116 }, 117 { 118 "type": "string", 119 "name": "fileName" 120 }, 121 { 122 "type": "function", 123 "name": "callback", 124 "parameters": [ 125 { 126 "type": "binary", 127 "optional": true, 128 "name": "thumbnail" 129 } 130 ] 131 } 132 ] 133 }, 134 { 135 "name": "setCustomWallpaperLayout", 136 "type": "function", 137 "description": "Sets current custom wallpaper to the specified layout", 138 "nodoc": "true", 139 "parameters": [ 140 { 141 "name": "layout", 142 "$ref": "WallpaperLayout" 143 }, 144 { 145 "type": "function", 146 "name": "callback", 147 "parameters": [] 148 } 149 ] 150 }, 151 { 152 "name": "minimizeInactiveWindows", 153 "type": "function", 154 "description": "Minimizes all inactive open windows.", 155 "nodoc": "true", 156 "parameters": [] 157 }, 158 { 159 "name": "restoreMinimizedWindows", 160 "type": "function", 161 "description": "Restores all previously minimized windows.", 162 "nodoc": "true", 163 "parameters": [] 164 }, 165 { 166 "name": "getThumbnail", 167 "type": "function", 168 "description": "Gets thumbnail of wallpaper from thumbnail directory.", 169 "nodoc": "true", 170 "parameters": [ 171 { 172 "type": "string", 173 "name": "urlOrFile", 174 "description": "URL of ONLINE wallpaper or file name of CUSTOM wallpaper" 175 }, 176 { 177 "name": "source", 178 "type": "string", 179 "enum": [ "ONLINE", "OEM" ] 180 }, 181 { 182 "type": "function", 183 "name": "callback", 184 "description": "Function called upon completion.", 185 "parameters": [ 186 { 187 "type": "binary", 188 "name": "data", 189 "optional": true, 190 "description": "The binary data of loaded thumbnail." 191 } 192 ] 193 } 194 ] 195 }, 196 { 197 "name": "saveThumbnail", 198 "type": "function", 199 "description": "Saves thumbnail to thumbnail directory.", 200 "nodoc": "true", 201 "parameters": [ 202 { 203 "type": "string", 204 "name": "url", 205 "description": "Wallpaper url." 206 }, 207 { 208 "type": "binary", 209 "name": "data", 210 "description": "The binary data of downloaded thumbnail." 211 }, 212 { 213 "type": "function", 214 "name": "callback", 215 "description": "Function called upon completion.", 216 "parameters": [], 217 "optional": true 218 } 219 ] 220 }, 221 { 222 "name": "getOfflineWallpaperList", 223 "type": "function", 224 "description": "Get the list of file names of downloaded wallpapers.", 225 "nodoc": "true", 226 "parameters": [ 227 { 228 "type": "function", 229 "name": "callback", 230 "description": "Function called upon completion.", 231 "parameters": [ 232 { 233 "type": "array", 234 "name": "results", 235 "items": {"type": "string"} 236 } 237 ] 238 } 239 ] 240 } 241 ] 242 } 243 ] 244