Skip to content
Snippets Groups Projects
Commit bf5b2054 authored by jam@chromium.org's avatar jam@chromium.org
Browse files

Look for the WMP plugin in the directory that it's left in if Firefox isn't installed.

BUG=22077
TEST=on a machine without Firefox, install the WMP NPAPI plugin and ensure that Chrome finds it
Review URL: http://codereview.chromium.org/214018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26594 0039d316-1c4b-4281-b951-d872f2087c98
parent fc97bc58
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,10 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/registry.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "webkit/glue/plugins/plugin_constants_win.h"
#include "webkit/glue/plugins/plugin_lib.h"
......@@ -149,6 +151,26 @@ void GetWindowsMediaDirectory(std::set<FilePath>* plugin_dirs) {
FilePath path;
if (GetInstalledPath(kRegistryWindowsMedia, &path))
plugin_dirs->insert(path);
// If the Windows Media Player Firefox plugin is installed before Firefox,
// the plugin will get written under PFiles\Plugins on one the drives
// (usually, but not always, the last letter).
int size = GetLogicalDriveStrings(0, NULL);
if (size) {
scoped_array<wchar_t> strings(new wchar_t[size]);
if (GetLogicalDriveStrings(size, strings.get())) {
wchar_t* next_drive = strings.get();
while (*next_drive) {
if (GetDriveType(next_drive) == DRIVE_FIXED) {
FilePath pfiles(next_drive);
pfiles = pfiles.Append(L"PFiles\\Plugins");
if (file_util::PathExists(pfiles))
plugin_dirs->insert(pfiles);
}
next_drive = &next_drive[wcslen(next_drive) + 1];
}
}
}
}
// Hardcoded logic to detect Java plugin location.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment