Commit 16dfd619 authored by bshe@chromium.org's avatar bshe@chromium.org

Add docs for chrome.wallpaper API


BUG=176183

Review URL: https://codereview.chromium.org/27335003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235758 0039d316-1c4b-4281-b951-d872f2087c98
parent 9e6f2729
......@@ -9,13 +9,12 @@
"implemented_in": "chrome/browser/chromeos/extensions/wallpaper_api.h"
},
"platforms": ["chromeos"],
"description": "none",
"description": "Use the <code>chrome.wallpaper</code> API to change the ChromeOS wallpaper.",
"functions": [
{
"name": "setWallpaper",
"type": "function",
"description": "Sets wallpaper to the image from url with specified layout",
"nodoc": "true",
"description": "Sets wallpaper to the image at <em>url</em> or <em>wallpaperData</em> with the specified <em>layout</em>",
"parameters": [
{
"name": "details",
......@@ -29,7 +28,7 @@
"url": {
"type": "string",
"optional": true,
"description": "The url of online wallpaper."
"description": "The URL of the wallpaper to be set."
},
"layout": {
"type": "string",
......@@ -38,7 +37,7 @@
},
"name": {
"type": "string",
"description": "The file name of saved wallpaper."
"description": "The file name of the saved wallpaper."
},
"thumbnail": {
"type": "boolean",
......@@ -54,7 +53,8 @@
{
"type": "binary",
"optional": true,
"name": "thumbnail"
"name": "thumbnail",
"description": "The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60."
}
]
}
......
<h2 id="manifest">Manifest</h2>
<p>You must declare the "wallpaper" permission in the app
<a href="manifest.html">manifest</a> to use the wallpaper API.
For example:</p>
<pre data-filename="manifest.json">
{
"name": "My extension",
...
<b>"permissions": [
"wallpaper"
]</b>,
...
}</pre>
<h2 id="overview-examples">Examples</h2>
<p>
For example, to set the wallpaper as the image at
<code>http://example.com/a_file.png</code>, you can call
<code>chrome.wallpaper.setWallpaper</code> this way:
</p>
<pre>
chrome.wallpaper.setWallpaper(
{
'url': 'http://example.com/a_file.jpg',
'layout': 'CENTER_CROPPED',
'name': 'test_wallpaper'
}, function() {});
</pre>
{{+partials.standard_extensions_api api:apis.wallpaper intro:intros.wallpaper/}}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment