From c331fa9ecb87cdcec189051b456350742e668925 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Mon, 14 Nov 2016 23:37:44 -0800 Subject: [PATCH] Bug 1317109 - Remove Acrobat plugin quirk handling. r=jimm --- dom/plugins/base/nsNPAPIPlugin.cpp | 17 ----- .../base/nsPluginDirServiceProvider.cpp | 64 ------------------- dom/plugins/base/nsPluginDirServiceProvider.h | 1 - dom/plugins/base/nsPluginHost.cpp | 7 +- dom/plugins/base/nsPluginHost.h | 2 - dom/plugins/base/nsPluginNativeWindowWin.cpp | 11 ---- modules/libpref/init/all.js | 3 - 7 files changed, 1 insertion(+), 104 deletions(-) diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index f5453e5e19a6..1cd046fe331e 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -724,23 +724,6 @@ _geturl(NPP npp, const char* relativeURL, const char* target) PluginDestructionGuard guard(npp); - // Block Adobe Acrobat from loading URLs that are not http:, https:, - // or ftp: URLs if the given target is null. - if (!target && relativeURL && - (strncmp(relativeURL, "http:", 5) != 0) && - (strncmp(relativeURL, "https:", 6) != 0) && - (strncmp(relativeURL, "ftp:", 4) != 0)) { - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *) npp->ndata; - - const char *name = nullptr; - RefPtr host = nsPluginHost::GetInst(); - host->GetPluginName(inst, &name); - - if (name && strstr(name, "Adobe") && strstr(name, "Acrobat")) { - return NPERR_NO_ERROR; - } - } - return MakeNewNPAPIStreamInternal(npp, relativeURL, target, eNPPStreamTypeInternal_Get); } diff --git a/dom/plugins/base/nsPluginDirServiceProvider.cpp b/dom/plugins/base/nsPluginDirServiceProvider.cpp index 92348c18296f..374b60906211 100644 --- a/dom/plugins/base/nsPluginDirServiceProvider.cpp +++ b/dom/plugins/base/nsPluginDirServiceProvider.cpp @@ -290,70 +290,6 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant, getter_AddRefs(localFile)); } } - } else if (nsCRT::strcmp(charProp, NS_WIN_ACROBAT_SCAN_KEY) == 0) { - nsAdoptingCString strVer = Preferences::GetCString(charProp); - if (!strVer) { - return NS_ERROR_FAILURE; - } - - verBlock minVer; - TranslateVersionStr(NS_ConvertASCIItoUTF16(strVer).get(), &minVer); - - // Look for Adobe Acrobat system installation plugins directory - verBlock maxVer; - ClearVersion(&maxVer); - - nsAutoString newestPath; - - rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE, - NS_LITERAL_STRING("software\\Adobe\\Acrobat Reader"), - nsIWindowsRegKey::ACCESS_READ); - if (NS_FAILED(rv)) { - rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE, - NS_LITERAL_STRING("software\\Adobe\\Adobe Acrobat"), - nsIWindowsRegKey::ACCESS_READ); - if (NS_FAILED(rv)) { - return NS_ERROR_FAILURE; - } - } - - // We must enumerate through the keys because what if there is - // more than one version? - uint32_t childCount = 0; - regKey->GetChildCount(&childCount); - - for (uint32_t index = 0; index < childCount; ++index) { - nsAutoString childName; - rv = regKey->GetChildName(index, childName); - if (NS_SUCCEEDED(rv)) { - verBlock curVer; - TranslateVersionStr(childName.get(), &curVer); - - childName += NS_LITERAL_STRING("\\InstallPath"); - - nsCOMPtr childKey; - rv = regKey->OpenChild(childName, nsIWindowsRegKey::ACCESS_QUERY_VALUE, - getter_AddRefs(childKey)); - if (NS_SUCCEEDED(rv)) { - // We have a sub key - nsAutoString path; - rv = childKey->ReadStringValue(NS_LITERAL_STRING(""), path); - if (NS_SUCCEEDED(rv)) { - if (CompareVersion(curVer, maxVer) >= 0 && - CompareVersion(curVer, minVer) >= 0) { - newestPath = path; - CopyVersion(&maxVer, &curVer); - } - } - } - } - } - - if (!newestPath.IsEmpty()) { - newestPath += NS_LITERAL_STRING("\\browser"); - rv = NS_NewLocalFile(newestPath, true, - getter_AddRefs(localFile)); - } } if (NS_FAILED(rv)) { diff --git a/dom/plugins/base/nsPluginDirServiceProvider.h b/dom/plugins/base/nsPluginDirServiceProvider.h index 1fc735d02189..11bb8943edc2 100644 --- a/dom/plugins/base/nsPluginDirServiceProvider.h +++ b/dom/plugins/base/nsPluginDirServiceProvider.h @@ -16,7 +16,6 @@ class nsISimpleEnumerator; // Note: Our directory service provider scan keys are prefs which are check // for minimum versions compatibility -#define NS_WIN_ACROBAT_SCAN_KEY "plugin.scan.Acrobat" #define NS_WIN_QUICKTIME_SCAN_KEY "plugin.scan.Quicktime" #define NS_WIN_WMP_SCAN_KEY "plugin.scan.WindowsMediaPlayer" diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 00c8cf4be260..0813fa1bc81d 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -1856,10 +1856,6 @@ nsPluginHost::GetSpecialType(const nsACString & aMIMEType) return eSpecialType_RealPlayer; } - if (aMIMEType.LowerCaseEqualsASCII("application/pdf")) { - return eSpecialType_PDF; - } - if (aMIMEType.LowerCaseEqualsASCII("application/vnd.unity")) { return eSpecialType_Unity; } @@ -2559,8 +2555,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange // Scan the installation paths of our popular plugins if the prefs are enabled // This table controls the order of scanning - const char* const prefs[] = {NS_WIN_ACROBAT_SCAN_KEY, - NS_WIN_QUICKTIME_SCAN_KEY, + const char* const prefs[] = {NS_WIN_QUICKTIME_SCAN_KEY, NS_WIN_WMP_SCAN_KEY}; uint32_t size = sizeof(prefs) / sizeof(prefs[0]); diff --git a/dom/plugins/base/nsPluginHost.h b/dom/plugins/base/nsPluginHost.h index 27e90c991fdb..8eb17218059f 100644 --- a/dom/plugins/base/nsPluginHost.h +++ b/dom/plugins/base/nsPluginHost.h @@ -205,8 +205,6 @@ public: // Some IPC quirks eSpecialType_Silverlight, // Native widget quirks - eSpecialType_PDF, - // Native widget quirks eSpecialType_RealPlayer, // Native widget quirks eSpecialType_Unity }; diff --git a/dom/plugins/base/nsPluginNativeWindowWin.cpp b/dom/plugins/base/nsPluginNativeWindowWin.cpp index 106dcaf77aca..91f96578aa05 100644 --- a/dom/plugins/base/nsPluginNativeWindowWin.cpp +++ b/dom/plugins/base/nsPluginNativeWindowWin.cpp @@ -627,17 +627,6 @@ nsresult nsPluginNativeWindowWin::CallSetWindow(RefPtr &a (WNDPROC)::GetWindowLongPtr((HWND)window, GWLP_WNDPROC); if (!mPrevWinProc && currentWndProc != PluginWndProc) mPrevWinProc = currentWndProc; - - // PDF plugin v7.0.9, v8.1.3, and v9.0 subclass parent window, bug 531551 - // V8.2.2 and V9.1 don't have such problem. - if (mPluginType == nsPluginHost::eSpecialType_PDF) { - HWND parent = ::GetParent((HWND)window); - if (mParentWnd != parent) { - NS_ASSERTION(!mParentWnd, "Plugin's parent window changed"); - mParentWnd = parent; - mParentProc = ::GetWindowLongPtr(mParentWnd, GWLP_WNDPROC); - } - } } nsPluginNativeWindow::CallSetWindow(aPluginInstance); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 482ce9528669..79c1aa40a6da 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -3435,9 +3435,6 @@ pref("print.print_extra_margin", 90); // twips (90 twips is an eigth of an inch) // Whether to extend the native dialog with information on printing frames. pref("print.extend_native_print_dialog", true); -// Locate plugins by scanning the Adobe Acrobat installation directory with a minimum version -pref("plugin.scan.Acrobat", "5.0"); - // Locate plugins by scanning the Quicktime installation directory with a minimum version pref("plugin.scan.Quicktime", "5.0");