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

Side by Side Diff: chrome/test/data/permissions/flash.html

Issue 2391743005: Make the flash permission prompt work properly on file: URLs (Closed)
Patch Set: test prompt Created 4 years, 2 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <script> 3 <script src="flash.js"></script>
4 function triggerPrompt() {
5 document.getElementById('flash-link').click();
6 window.domAutomationController.send(true);
7 }
8
9 function triggerPromptViaNewWindow() {
10 document.getElementById('flash-new-window-link').click();
11 window.domAutomationController.send(true);
12 }
13
14 function flashIsEnabledForPlugin(plugin) {
15 plugin.addEventListener('message', function handleEvent(event) {
16 if (event.data.source === 'getPowerSaverStatusResponse') {
17 plugin.removeEventListener('message', handleEvent);
18 window.domAutomationController.send(true);
19 }
20 });
21 if (plugin.postMessage)
22 plugin.postMessage('getPowerSaverStatus');
23 else
24 window.domAutomationController.send(false);
25 }
26
27 function flashIsEnabled() {
28 flashIsEnabledForPlugin(document.getElementById('flash-object'));
29 }
30
31 function flashIsEnabledForPluginWithoutFallback() {
32 flashIsEnabledForPlugin(
33 document.getElementById('flash-object-no-fallback'));
34 }
35 </script>
36 <body> 4 <body>
37 <object id="flash-object-no-fallback" data="test.swf" 5 <object id="flash-object-no-fallback" data="test.swf"
38 type="application/x-shockwave-flash" width="400" height="100"> 6 type="application/x-shockwave-flash" width="400" height="100">
39 </object> 7 </object>
40 <object id="flash-object" data="test.swf" 8 <object id="flash-object" data="test.swf"
41 type="application/x-shockwave-flash" width="400" height="100"> 9 type="application/x-shockwave-flash" width="400" height="100">
42 Flash not supported. 10 Flash not supported.
43 <br> 11 <br>
44 <a href="https://get.adobe.com/flashplayer/" id="flash-link"> 12 <a href="https://get.adobe.com/flashplayer/" id="flash-link">
45 Download Flash. 13 Download Flash.
46 </a> 14 </a>
47 <a id="flash-new-window-link" 15 <a id="flash-new-window-link"
48 onclick="window.open('https://get.adobe.com/flashplayer/');"> 16 onclick="window.open('https://get.adobe.com/flashplayer/');">
49 Download Flash window.open 17 Download Flash window.open
50 </a> 18 </a>
51 </object> 19 </object>
52 </body> 20 </body>
53 </html> 21 </html>
OLDNEW
« no previous file with comments | « chrome/browser/plugins/flash_permission_context.cc ('k') | chrome/test/data/permissions/flash.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698