/src/mozilla-central/dom/plugins/ipc/PluginQuirks.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
2 | | * vim: sw=4 ts=4 et : |
3 | | * This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "PluginQuirks.h" |
8 | | |
9 | | #include "nsPluginHost.h" |
10 | | |
11 | | namespace mozilla { |
12 | | namespace plugins { |
13 | | |
14 | | int GetQuirksFromMimeTypeAndFilename(const nsCString& aMimeType, |
15 | | const nsCString& aPluginFilename) |
16 | 0 | { |
17 | 0 | int quirks = 0; |
18 | 0 |
|
19 | 0 | nsPluginHost::SpecialType specialType = nsPluginHost::GetSpecialType(aMimeType); |
20 | 0 |
|
21 | 0 | if (specialType == nsPluginHost::eSpecialType_Flash) { |
22 | 0 | quirks |= QUIRK_FLASH_RETURN_EMPTY_DOCUMENT_ORIGIN; |
23 | | #ifdef OS_WIN |
24 | | quirks |= QUIRK_WINLESS_TRACKPOPUP_HOOK; |
25 | | quirks |= QUIRK_FLASH_THROTTLE_WMUSER_EVENTS; |
26 | | quirks |= QUIRK_FLASH_HOOK_SETLONGPTR; |
27 | | quirks |= QUIRK_FLASH_HOOK_GETWINDOWINFO; |
28 | | quirks |= QUIRK_FLASH_FIXUP_MOUSE_CAPTURE; |
29 | | quirks |= QUIRK_WINLESS_HOOK_IME; |
30 | | #if defined(_M_X64) || defined(__x86_64__) |
31 | | quirks |= QUIRK_FLASH_HOOK_GETKEYSTATE; |
32 | | quirks |= QUIRK_FLASH_HOOK_PRINTDLGW; |
33 | | quirks |= QUIRK_FLASH_HOOK_SSL; |
34 | | quirks |= QUIRK_FLASH_HOOK_CREATEMUTEXW; |
35 | | #endif |
36 | | #endif |
37 | | } |
38 | 0 |
|
39 | | #ifdef XP_MACOSX |
40 | | // Whitelist Flash to support offline renderer. |
41 | | if (specialType == nsPluginHost::eSpecialType_Flash) { |
42 | | quirks |= QUIRK_ALLOW_OFFLINE_RENDERER; |
43 | | } |
44 | | #endif |
45 | |
|
46 | | #ifdef OS_WIN |
47 | | if (specialType == nsPluginHost::eSpecialType_Test) { |
48 | | quirks |= QUIRK_WINLESS_HOOK_IME; |
49 | | } |
50 | | #endif |
51 | |
|
52 | 0 | return quirks; |
53 | 0 | } |
54 | | |
55 | | } /* namespace plugins */ |
56 | | } /* namespace mozilla */ |