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

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

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
« no previous file with comments | « chrome/test/data/permissions/flash.html ('k') | chrome/test/data/permissions/flash2.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 function triggerPrompt() {
6 document.getElementById('flash-link').click();
7 window.domAutomationController.send(true);
8 }
9
10 function triggerPromptViaNewWindow() {
11 document.getElementById('flash-new-window-link').click();
12 window.domAutomationController.send(true);
13 }
14
15 function flashIsEnabledForPlugin(plugin) {
16 plugin.addEventListener('message', function handleEvent(event) {
17 if (event.data.source === 'getPowerSaverStatusResponse') {
18 plugin.removeEventListener('message', handleEvent);
19 window.domAutomationController.send(true);
20 }
21 });
22 if (plugin.postMessage)
23 plugin.postMessage('getPowerSaverStatus');
24 else
25 window.domAutomationController.send(false);
26 }
27
28 function flashIsEnabled() {
29 flashIsEnabledForPlugin(document.getElementById('flash-object'));
30 }
31
32 function flashIsEnabledForPluginWithoutFallback() {
33 flashIsEnabledForPlugin(
34 document.getElementById('flash-object-no-fallback'));
35 }
OLDNEW
« no previous file with comments | « chrome/test/data/permissions/flash.html ('k') | chrome/test/data/permissions/flash2.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698