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

Unified Diff: ppapi/examples/crxfs/crxfs.js

Issue 14188019: CRX FileSystem Pepper private API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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: ppapi/examples/crxfs/crxfs.js
diff --git a/ppapi/examples/crxfs/crxfs.js b/ppapi/examples/crxfs/crxfs.js
new file mode 100644
index 0000000000000000000000000000000000000000..cfd6cf3fb87c9f855b30da21d70c67260c1ecf40
--- /dev/null
+++ b/ppapi/examples/crxfs/crxfs.js
@@ -0,0 +1,19 @@
+function StartRequest() {
+ var plugin = document.getElementById("plugin");
+ var filename = document.getElementById("filename").value;
+ plugin.postMessage(filename);
+}
+
+function HandleMessage(message_event) {
+ document.getElementById("content").value = message_event.data;
+}
+
+document.addEventListener('DOMContentLoaded', function () {
+ // Attach a listener for the message event. This must happen after the plugin
+ // object was created.
+ document.getElementById("plugin")
+ .addEventListener("message", HandleMessage, false);
+
+ document.getElementById("start")
+ .addEventListener("click", StartRequest, false);
+});

Powered by Google App Engine
This is Rietveld 408576698