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

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

Issue 11377089: browser-plugin: Send a JSON string for the detail data with the events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin_browsertest.cc ('k') | 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 <script type="text/javascript"> 1 <script type="text/javascript">
2 function loadAbort(evt) { 2 function loadAbort(evt) {
3 document.title = evt.detail.reason; 3 document.title = JSON.parse(evt.detail).reason;
4 } 4 }
5 function loadStart(evt) { 5 function loadStart(evt) {
6 document.title = evt.detail.url; 6 document.title = JSON.parse(evt.detail).url;
7 } 7 }
8 function loadStop(evt) { 8 function loadStop(evt) {
9 document.title = "loadStop"; 9 document.title = "loadStop";
10 } 10 }
11 11
12 var commitIsTopLevel; 12 var commitIsTopLevel;
13 function loadCommit(evt) { 13 function loadCommit(evt) {
14 document.title = "loadCommit:" + evt.detail.url; 14 var detail = JSON.parse(evt.detail);
15 commitIsTopLevel = evt.detail.isTopLevel; 15 document.title = "loadCommit:" + detail.url;
16 commitIsTopLevel = detail.isTopLevel;
16 } 17 }
17 18
18 var redirectOldUrl; 19 var redirectOldUrl;
19 var redirectNewUrl; 20 var redirectNewUrl;
20 function loadRedirect(event) { 21 function loadRedirect(event) {
21 document.title = "redirected"; 22 document.title = "redirected";
22 if (event.detail.isTopLevel) { 23 var detail = JSON.parse(event.detail);
23 redirectOldUrl = event.detail.oldUrl; 24 if (detail.isTopLevel) {
24 redirectNewUrl = event.detail.newUrl; 25 redirectOldUrl = detail.oldUrl;
26 redirectNewUrl = detail.newUrl;
25 } 27 }
26 } 28 }
27 function SetSrc(src) { 29 function SetSrc(src) {
28 var plugin = document.getElementById('plugin'); 30 var plugin = document.getElementById('plugin');
29 plugin.src = src; 31 plugin.src = src;
30 } 32 }
31 function SetSize(w, h) { 33 function SetSize(w, h) {
32 var plugin = document.getElementById('plugin'); 34 var plugin = document.getElementById('plugin');
33 plugin.width = w; 35 plugin.width = w;
34 plugin.height = h; 36 plugin.height = h;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 97 }
96 } 98 }
97 var plugin = document.getElementById('plugin'); 99 var plugin = document.getElementById('plugin');
98 plugin.addEventListener('-internal-loadstart', loadStart); 100 plugin.addEventListener('-internal-loadstart', loadStart);
99 plugin.addEventListener('-internal-loadabort', loadAbort); 101 plugin.addEventListener('-internal-loadabort', loadAbort);
100 plugin.addEventListener('-internal-loadredirect', loadRedirect); 102 plugin.addEventListener('-internal-loadredirect', loadRedirect);
101 window.addEventListener('message', receiveMessage, false); 103 window.addEventListener('message', receiveMessage, false);
102 plugin.addEventListener('-internal-loadstop', loadStop); 104 plugin.addEventListener('-internal-loadstop', loadStop);
103 plugin.addEventListener('-internal-loadcommit', loadCommit); 105 plugin.addEventListener('-internal-loadcommit', loadCommit);
104 </script> 106 </script>
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698