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

Side by Side Diff: ppapi/example/example.html

Issue 6156004: Add ability to toggle the size of the plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <body style="background-image:url(http://www.google.com/intl/en_ALL/images/logo. gif); 1 <body style="background-image:url(http://www.google.com/intl/en_ALL/images/logo. gif);
2 background-repeat:repeat"> 2 background-repeat:repeat"
3 onload="SetPluginSize(400, 400)">
3 4
4 <script type="text/javascript"> 5 <script type="text/javascript">
6 isPluginDefaultSize = true;
7
5 function Test() { 8 function Test() {
6 plugin = document.getElementById('plugin'); 9 plugin = document.getElementById('plugin');
7 // Confirm that this no longer segfaults. 10 // Confirm that this no longer segfaults.
8 alert(plugin.toString(new Array(10))); 11 alert(plugin.toString(new Array(10)));
9 } 12 }
10 13
14 function SetPluginSize(width, height) {
15 plugin = document.getElementById('plugin');
16 size = document.getElementById('size');
17 plugin.width = width;
18 plugin.height = height;
19 size.innerHTML = "Height: " + plugin.width + ' Width: ' + plugin.height;
20 }
21
22 function ToggleSize() {
23 if (!isPluginDefaultSize) {
24 SetPluginSize(400, 400);
25 isPluginDefaultSize = true;
26 } else {
27 SetPluginSize(1000, 800);
28 isPluginDefaultSize = false;
29 }
30 }
11 </script> 31 </script>
12 32
13 <button onclick='Test()'>Test</button> 33 <button onclick='Test()'>Test</button>
14 <div id="fps" style="background-color:white; font-weight:bold; padding:4px;">F PS GOES HERE</div> 34 <button onclick='ToggleSize()'>Toggle Size</button>
15 <object id="plugin" type="application/x-ppapi-example" width="400" height="400 " /> 35 <div id="fps" style="background-color:white; font-weight:bold; padding:4px; wi dth:200px;">FPS GOES HERE</div>
36 <div id="size" style="background-color:white; font-weight:bold; padding:4px; w idth:200px;"></div>
37 <object id="plugin" type="application/x-ppapi-example" width="400" height="400 " border="2px"></object>
16 <hr> 38 <hr>
17 </body> 39 </body>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698