OLD | NEW |
(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 } |
OLD | NEW |