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 <appview> 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> |