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

Unified Diff: content/common/plugin_list_win.cc

Issue 324593004: Windows: Add an "Open in Adobe Reader" menu item for PDF files in the download shelf. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/common/plugin_list_win.cc
diff --git a/content/common/plugin_list_win.cc b/content/common/plugin_list_win.cc
index e7d4b4b904bf5255f0eebfd9ac020f76702340ac..e659b8e4ee783a8dc05612e3a06bd8a06588cf74 100644
--- a/content/common/plugin_list_win.cc
+++ b/content/common/plugin_list_win.cc
@@ -22,18 +22,14 @@
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
#include "content/common/plugin_constants_win.h"
+#include "content/public/common/registry_utils_win.h"
namespace content {
namespace {
-const base::char16 kRegistryApps[] =
- L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths";
const base::char16 kRegistryFirefox[] = L"firefox.exe";
-const base::char16 kRegistryAcrobat[] = L"Acrobat.exe";
-const base::char16 kRegistryAcrobatReader[] = L"AcroRd32.exe";
const base::char16 kRegistryWindowsMedia[] = L"wmplayer.exe";
const base::char16 kRegistryQuickTime[] = L"QuickTimePlayer.exe";
-const base::char16 kRegistryPath[] = L"Path";
const base::char16 kRegistryFirefoxInstalled[] =
L"SOFTWARE\\Mozilla\\Mozilla Firefox";
const base::char16 kRegistryJava[] =
@@ -41,8 +37,6 @@ const base::char16 kRegistryJava[] =
const base::char16 kRegistryBrowserJavaVersion[] = L"BrowserJavaVersion";
const base::char16 kRegistryCurrentJavaVersion[] = L"CurrentVersion";
const base::char16 kRegistryJavaHome[] = L"JavaHome";
-const base::char16 kJavaDeploy1[] = L"npdeploytk.dll";
-const base::char16 kJavaDeploy2[] = L"npdeployjava1.dll";
base::FilePath AppendPluginsDir(const base::FilePath& path) {
return path.AppendASCII("plugins");
@@ -68,30 +62,6 @@ void GetExeDirectory(std::set<base::FilePath>* plugin_dirs) {
plugin_dirs->insert(AppendPluginsDir(exe_path));
}
-// Gets the installed path for a registered app.
-bool GetInstalledPath(const base::char16* app, base::FilePath* out) {
- base::string16 reg_path(kRegistryApps);
- reg_path.append(L"\\");
- reg_path.append(app);
-
- base::win::RegKey hkcu_key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ);
- base::string16 path;
- // As of Win7 AppPaths can also be registered in HKCU: http://goo.gl/UgFOf.
- if (base::win::GetVersion() >= base::win::VERSION_WIN7 &&
- hkcu_key.ReadValue(kRegistryPath, &path) == ERROR_SUCCESS) {
- *out = base::FilePath(path);
- return true;
- } else {
- base::win::RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ);
- if (hklm_key.ReadValue(kRegistryPath, &path) == ERROR_SUCCESS) {
- *out = base::FilePath(path);
- return true;
- }
- }
-
- return false;
-}
-
// Search the registry at the given path and detect plugin directories.
void GetPluginsInRegistryDirectory(
HKEY root_key,
@@ -324,7 +294,8 @@ void PluginList::GetPluginDirectories(
GetQuicktimeDirectory(&dirs);
GetWindowsMediaDirectory(&dirs);
- for (std::set<base::FilePath>::iterator i = dirs.begin(); i != dirs.end(); ++i)
+ for (std::set<base::FilePath>::iterator i = dirs.begin();
+ i != dirs.end(); ++i)
plugin_dirs->push_back(*i);
}
@@ -388,8 +359,8 @@ bool PluginList::ShouldLoadPluginUsingPluginList(
base::FilePath::StringType plugin2 =
StringToLowerASCII(info.path.BaseName().value());
if ((plugin1 == plugin2 && HaveSharedMimeType((*plugins)[j], info)) ||
- (plugin1 == kJavaDeploy1 && plugin2 == kJavaDeploy2) ||
- (plugin1 == kJavaDeploy2 && plugin2 == kJavaDeploy1)) {
+ (plugin1 == kJavaPlugin2 && plugin2 == kJavaPlugin3) ||
+ (plugin1 == kJavaPlugin3 && plugin2 == kJavaPlugin2)) {
if (IsNewerVersion(info.version, (*plugins)[j].version))
return false; // We have loaded a plugin whose version is newer.
plugins->erase(plugins->begin() + j);

Powered by Google App Engine
This is Rietveld 408576698