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

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

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

Powered by Google App Engine
This is Rietveld 408576698