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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/templates/intros/wallpaper.html
diff --git a/chrome/common/extensions/docs/templates/intros/wallpaper.html b/chrome/common/extensions/docs/templates/intros/wallpaper.html
new file mode 100644
index 0000000000000000000000000000000000000000..b9ea3c4b040f0910817697cf298ef38b87bf6b23
--- /dev/null
+++ b/chrome/common/extensions/docs/templates/intros/wallpaper.html
@@ -0,0 +1,34 @@
+<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. If you use the
+'url' property of setWallpaper, you must also specify
+<a href="declare_permissions.html">host permissions</a> for the URL in the
not at google - send to devlin 2013/10/17 18:18:20 move this into permissions/wallpaper.html
bshe 2013/10/17 20:32:18 It looks like the permissions/wallpaper.html shoul
+manifest.
+For example:</p>
+<pre data-filename="manifest.json">
+{
+ "name": "My extension",
+ ...
+ <b>"permissions": [
+ "wallpaper",
+ "http://example.com/*"
+ ]</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() { console.error(chrome.runtime.lastError.message); });
not at google - send to devlin 2013/10/17 18:18:20 why are you printing out the error? is this functi
bshe 2013/10/17 20:32:18 If the XMLRequest failed (user forgot to specify h
+</pre>

Powered by Google App Engine
This is Rietveld 408576698