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

Side by Side Diff: content/test/data/browser_plugin_embedder.html

Issue 11368071: browser-plugin: Remove event handling code, and use CustomEvents in webkit instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 1 month 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
OLDNEW
1 <script type="text/javascript"> 1 <script type="text/javascript">
2 function sizeChanged(evt) { 2 function sizeChanged(evt) {
3 document.title = "AutoSize(" + evt.newWidth + ", " + evt.newHeight + ")"; 3 var data = JSON.parse(evt.detail);
4 document.title = "AutoSize(" + data.newWidth + ", " + data.newHeight + ")";
4 } 5 }
5 6
6 function loadAbort(evt) { 7 function loadAbort(evt) {
7 document.title = evt.type; 8 document.title = JSON.parse(evt.detail).reason;
Charlie Reis 2012/11/12 18:23:12 I'm trying to understand what we're exposing to re
sadrul 2012/11/12 19:00:16 That is correct.
8 } 9 }
9 function loadStart(evt) { 10 function loadStart(evt) {
10 document.title = evt.url; 11 document.title = JSON.parse(evt.detail).url;
11 } 12 }
12 function loadStop(evt) { 13 function loadStop(evt) {
13 document.title = "loadStop"; 14 document.title = "loadStop";
14 } 15 }
15 16
16 var commitIsTopLevel; 17 var commitIsTopLevel;
17 function loadCommit(evt) { 18 function loadCommit(evt) {
18 document.title = "loadCommit:" + evt.url; 19 var detail = JSON.parse(evt.detail);
19 commitIsTopLevel = evt.isTopLevel; 20 document.title = "loadCommit:" + detail.url;
21 commitIsTopLevel = detail.isTopLevel;
20 } 22 }
21 23
22 var redirectOldUrl; 24 var redirectOldUrl;
23 var redirectNewUrl; 25 var redirectNewUrl;
24 function loadRedirect(event) { 26 function loadRedirect(event) {
25 document.title = "redirected"; 27 document.title = "redirected";
26 if (event.isTopLevel) { 28 var detail = JSON.parse(event.detail);
27 redirectOldUrl = event.oldUrl; 29 if (detail.isTopLevel) {
28 redirectNewUrl = event.newUrl; 30 redirectOldUrl = detail.oldUrl;
31 redirectNewUrl = detail.newUrl;
29 } 32 }
30 } 33 }
31 function SetSrc(src) { 34 function SetSrc(src) {
32 var plugin = document.getElementById('plugin'); 35 var plugin = document.getElementById('plugin');
33 plugin.src = src; 36 plugin.src = src;
34 } 37 }
35 function SetSize(w, h) { 38 function SetSize(w, h) {
36 var plugin = document.getElementById('plugin'); 39 var plugin = document.getElementById('plugin');
37 plugin.width = w; 40 plugin.width = w;
38 plugin.height = h; 41 plugin.height = h;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } else { 95 } else {
93 var name = msg.replace("stop_ack", "").trim(); 96 var name = msg.replace("stop_ack", "").trim();
94 if (name !== '') { 97 if (name !== '') {
95 window.document.title = name; 98 window.document.title = name;
96 } else { 99 } else {
97 window.document.title = 'main guest'; 100 window.document.title = 'main guest';
98 } 101 }
99 } 102 }
100 } 103 }
101 var plugin = document.getElementById('plugin'); 104 var plugin = document.getElementById('plugin');
102 plugin.addEventListener('loadstart', loadStart); 105 plugin.addEventListener('-internal-loadstart', loadStart);
103 plugin.addEventListener('loadabort', loadAbort); 106 plugin.addEventListener('-internal-loadabort', loadAbort);
104 plugin.addEventListener('loadredirect', loadRedirect); 107 plugin.addEventListener('-internal-loadredirect', loadRedirect);
105 window.addEventListener('message', receiveMessage, false); 108 window.addEventListener('message', receiveMessage, false);
106 plugin.addEventListener('loadstop', loadStop); 109 plugin.addEventListener('-internal-loadstop', loadStop);
107 plugin.addEventListener('loadcommit', loadCommit); 110 plugin.addEventListener('-internal-loadcommit', loadCommit);
108 plugin.addEventListener('sizechanged', sizeChanged); 111 plugin.addEventListener('-internal-sizechanged', sizeChanged);
109 </script> 112 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698