OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
6 | 6 |
7 #include <tchar.h> | 7 #include <tchar.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 FilePath path; | 158 FilePath path; |
159 if (GetInstalledPath(kRegistryQuickTime, &path)) | 159 if (GetInstalledPath(kRegistryQuickTime, &path)) |
160 plugin_dirs->insert(path.Append(L"plugins")); | 160 plugin_dirs->insert(path.Append(L"plugins")); |
161 } | 161 } |
162 | 162 |
163 // Hardcoded logic to detect Windows Media Player plugin location. | 163 // Hardcoded logic to detect Windows Media Player plugin location. |
164 void GetWindowsMediaDirectory(std::set<FilePath>* plugin_dirs) { | 164 void GetWindowsMediaDirectory(std::set<FilePath>* plugin_dirs) { |
165 FilePath path; | 165 FilePath path; |
166 if (GetInstalledPath(kRegistryWindowsMedia, &path)) | 166 if (GetInstalledPath(kRegistryWindowsMedia, &path)) |
167 plugin_dirs->insert(path); | 167 plugin_dirs->insert(path); |
168 | |
169 // If the Windows Media Player Firefox plugin is installed before Firefox, | |
170 // the plugin will get written under PFiles\Plugins on one the drives | |
171 // (usually, but not always, the last letter). | |
172 int size = GetLogicalDriveStrings(0, NULL); | |
173 if (size) { | |
174 scoped_array<wchar_t> strings(new wchar_t[size]); | |
175 if (GetLogicalDriveStrings(size, strings.get())) { | |
176 wchar_t* next_drive = strings.get(); | |
177 while (*next_drive) { | |
178 if (GetDriveType(next_drive) == DRIVE_FIXED) { | |
179 FilePath pfiles(next_drive); | |
180 pfiles = pfiles.Append(L"PFiles\\Plugins"); | |
181 if (file_util::PathExists(pfiles)) | |
182 plugin_dirs->insert(pfiles); | |
183 } | |
184 next_drive = &next_drive[wcslen(next_drive) + 1]; | |
185 } | |
186 } | |
187 } | |
188 } | 168 } |
189 | 169 |
190 // Hardcoded logic to detect Java plugin location. | 170 // Hardcoded logic to detect Java plugin location. |
191 void GetJavaDirectory(std::set<FilePath>* plugin_dirs) { | 171 void GetJavaDirectory(std::set<FilePath>* plugin_dirs) { |
192 // Load the new NPAPI Java plugin | 172 // Load the new NPAPI Java plugin |
193 // 1. Open the main JRE key under HKLM | 173 // 1. Open the main JRE key under HKLM |
194 base::win::RegKey java_key(HKEY_LOCAL_MACHINE, kRegistryJava, | 174 base::win::RegKey java_key(HKEY_LOCAL_MACHINE, kRegistryJava, |
195 KEY_QUERY_VALUE); | 175 KEY_QUERY_VALUE); |
196 | 176 |
197 // 2. Read the current Java version | 177 // 2. Read the current Java version |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 424 |
445 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path))) | 425 if (file_util::PathExists(info.path) && (!IsValid32BitImage(info.path))) |
446 load_plugin = false; | 426 load_plugin = false; |
447 break; | 427 break; |
448 } | 428 } |
449 return load_plugin; | 429 return load_plugin; |
450 } | 430 } |
451 | 431 |
452 } // namespace npapi | 432 } // namespace npapi |
453 } // namespace webkit | 433 } // namespace webkit |
OLD | NEW |