Chromium Code Reviews| 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..f0d67e891fc4642b93fb0011343db917cb03efd6 |
| --- /dev/null |
| +++ b/chrome/common/extensions/docs/templates/intros/appview_tag.html |
| @@ -0,0 +1,34 @@ |
| +<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) {<br> request.allow("foo.html");<br>});</pre> |
|
not at google - send to devlin
2015/03/03 23:50:58
If this is in <pre> you don't need the <br>s, just
lfg
2015/03/04 21:13:02
Done.
|
| + |
| +<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 packaged (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">var appview = document.createElement("appview");<br>document.body.appendChild(appview);<br>appview.connect(appToEmbed, {}, function(success) {});</pre> |
|
not at google - send to devlin
2015/03/03 23:50:58
What is the {} after appToEmbed? It looks odd. It
lfg
2015/03/04 21:13:02
Done.
|