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

Unified Diff: chrome/common/extensions/docs/templates/intros/appview_tag.html

Issue 921793004: <appview> documentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wrapping Created 5 years, 10 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/appview_tag.html
diff --git a/chrome/common/extensions/docs/templates/intros/appview_tag.html b/chrome/common/extensions/docs/templates/intros/appview_tag.html
new file mode 100644
index 0000000000000000000000000000000000000000..18b47676bd29dce3c4aa54641cb4a8ab4a3db5ed
--- /dev/null
+++ b/chrome/common/extensions/docs/templates/intros/appview_tag.html
@@ -0,0 +1,47 @@
+<h2 id="usage">Usage</h2>
+
+<p>
+Use the <code>appview</code> tag to embed other Chrome Apps within your Chrome
+App.
+</p>
+
+<p>
+The <code>appview</code> runs in a separate process from your app, it doesn't
+inherit the same permissions and is only allowed to interact with your app
+through asynchronous APIs.
+Not all apps can be embedded; apps have to explicitly allow themselves to be
+embedded.
+</p>
+
+<h2 id="embedder">Preparing your app to be embedded</h2>
+
+<p>
+To allow your app to be embedded into another app, you need to add a listener
+to your app's background page:
+</p>
+
+<pre data-filename="background.js">
+chrome.app.runtime.onEmbedRequested.addListener(function(request) {
+ // Allows the embedder to embed foo.html.
+ request.allow("foo.html");
+});
+</pre>
+
+<h2 id="embedded">Embedding another app</h2>
+
+<p>
+To embed another Chrome App in your app, add the <code>appview</code> tag to
+your app's embedder page (this is the app page that will display the
+embedded app) and use the connect API to request the embedding of the other
+app.
+</p>
+
+<pre data-filename="background.js">
+// Creates an &lt;appview&gt; element.
+var appview = document.createElement("appview");
+// Appends the element to the document body.
+document.body.appendChild(appview);
+// Connects the appview to appToEmbed.
+// appToEmbed is the id of the app you are trying to embed.
+appview.connect(appToEmbed);
+</pre>
« no previous file with comments | « chrome/common/extensions/api/appview_tag.idl ('k') | chrome/common/extensions/docs/templates/json/chrome_sidenav.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698