Chromium Code Reviews| Index: webkit/glue/plugins/plugin_list_win.cc |
| =================================================================== |
| --- webkit/glue/plugins/plugin_list_win.cc (revision 26521) |
| +++ webkit/glue/plugins/plugin_list_win.cc (working copy) |
| @@ -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 @@ |
| 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(); |
|
ananta
2009/09/18 17:43:57
wchar_t* ?
|
| + 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. |