Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: chrome/common/extensions/docs/templates/intros/wallpaper.html

Issue 27335003: Add docs for chrome.wallpaper API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <h2 id="manifest">Manifest</h2>
2 <p>You must declare the "wallpaper" permission in the app
3 <a href="manifest.html">manifest</a> to use the wallpaper API. If you use the
4 'url' property of setWallpaper, you must also specify
5 <a href="declare_permissions.html">host permissions</a> for the URL in the
6 manifest.
7 For example:</p>
8 <pre data-filename="manifest.json">
9 {
10 "name": "My extension",
11 ...
12 <b>"permissions": [
13 "wallpaper",
14 "http://example.com/*"
15 ]</b>,
16 ...
17 }</pre>
18
19 <h2 id="overview-examples">Examples</h2>
20
21 <p>
22 For example, to set the wallpaper as the image at
23 <code>http://example.com/a_file.png</code>, you can call
24 <code>chrome.wallpaper.setWallpaper</code> this way:
25 </p>
26
27 <pre>
28 chrome.wallpaper.setWallpaper(
29 {
30 'url': 'http://example.com/a_file.jpg',
31 'layout': 'CENTER_CROPPED',
32 'name': 'test_wallpaper'
33 }, function() { console.error(chrome.runtime.lastError.message); });
34 </pre>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698