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

Unified Diff: ppapi/native_client/tests/ppapi_example_events/ppapi_example_events.html

Issue 7740013: Cloning a bunch of stuff from the native_client repository at r6528 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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/native_client/tests/ppapi_example_events/ppapi_example_events.html
===================================================================
--- ppapi/native_client/tests/ppapi_example_events/ppapi_example_events.html (revision 0)
+++ ppapi/native_client/tests/ppapi_example_events/ppapi_example_events.html (revision 0)
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+ <!--
+ Copyright (c) 2011 The Native Client Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file.
+ -->
+<head>
+ <title>PPAPI InputEvent test</title>
+
+ <script type="text/javascript">
+ function $(id) {
+ return document.getElementById(id);
+ }
+
+ var events = '';
+
+ function receiveMessage(message) {
+ events += message.data;
+ }
+
+ function getEvents() {
+ try {
+ var event_dump = $('event_dump');
+ event_dump.firstChild.nodeValue = events;
+ events = '';
+ } catch(e) {
+ alert(e.message);
+ }
+ }
+ </script>
+</head>
+<body>
+<h1>InputEvent Handling Example</h1>
+ <div id="listener">
+ <script type="text/javascript">
+ $('listener').addEventListener('message', receiveMessage, true);
+ </script>
+
+ <embed name="nacl_module"
+ id="event_module"
+ width=400 height=400
+ src="ppapi_example_events.nmf"
+ type="application/x-nacl"
+ style="background-color:gray" />
+ </div>
+<p>
+This example demonstrates handling of input events in PPAPI.
+<p>
+Each time an input event happens in the context of the gray box,
+the embedded NaCl module prints a message describing the event to the shell
+where you started your Browser.
+<p>
+Alternatively, you can click the "Get Events" button to display
+all input events that have happened since the last time you clicked the
+button.
+</p>
+<form name="event_form" action="" method="get">
+ <input type="button" value="Get Events" onclick="getEvents()"/>
+</form>
+
+<h2>Recent Events (press button to update):</h2>
+<pre id=event_dump>
+no events
+</pre>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698