| OLD | NEW |
| 1 // Copyright (c) 2012 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 "content/common/plugin_list.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/file_version_info.h" | 11 #include "base/file_version_info.h" |
| 12 #include "base/file_version_info_win.h" | 12 #include "base/file_version_info_win.h" |
| 13 #include "base/files/memory_mapped_file.h" | 13 #include "base/files/memory_mapped_file.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/win/pe_image.h" | 19 #include "base/win/pe_image.h" |
| 20 #include "base/win/registry.h" | 20 #include "base/win/registry.h" |
| 21 #include "base/win/scoped_handle.h" | 21 #include "base/win/scoped_handle.h" |
| 22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 23 #include "webkit/plugins/npapi/plugin_constants_win.h" | 23 #include "content/common/plugin_constants_win.h" |
| 24 |
| 25 using webkit::WebPluginInfo; |
| 24 | 26 |
| 25 namespace { | 27 namespace { |
| 26 | 28 |
| 27 const char16 kRegistryApps[] = | 29 const char16 kRegistryApps[] = |
| 28 L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths"; | 30 L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths"; |
| 29 const char16 kRegistryFirefox[] = L"firefox.exe"; | 31 const char16 kRegistryFirefox[] = L"firefox.exe"; |
| 30 const char16 kRegistryAcrobat[] = L"Acrobat.exe"; | 32 const char16 kRegistryAcrobat[] = L"Acrobat.exe"; |
| 31 const char16 kRegistryAcrobatReader[] = L"AcroRd32.exe"; | 33 const char16 kRegistryAcrobatReader[] = L"AcroRd32.exe"; |
| 32 const char16 kRegistryWindowsMedia[] = L"wmplayer.exe"; | 34 const char16 kRegistryWindowsMedia[] = L"wmplayer.exe"; |
| 33 const char16 kRegistryQuickTime[] = L"QuickTimePlayer.exe"; | 35 const char16 kRegistryQuickTime[] = L"QuickTimePlayer.exe"; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 if (cur_a > cur_b) | 252 if (cur_a > cur_b) |
| 251 return false; | 253 return false; |
| 252 if (cur_a < cur_b) | 254 if (cur_a < cur_b) |
| 253 return true; | 255 return true; |
| 254 } | 256 } |
| 255 return false; | 257 return false; |
| 256 } | 258 } |
| 257 | 259 |
| 258 } // namespace | 260 } // namespace |
| 259 | 261 |
| 260 namespace webkit { | 262 namespace content { |
| 261 namespace npapi { | |
| 262 | 263 |
| 263 bool PluginList::ReadWebPluginInfo(const base::FilePath& filename, | 264 bool PluginList::ReadWebPluginInfo(const base::FilePath& filename, |
| 264 webkit::WebPluginInfo* info) { | 265 webkit::WebPluginInfo* info) { |
| 265 // On windows, the way we get the mime types for the library is | 266 // On windows, the way we get the mime types for the library is |
| 266 // to check the version information in the DLL itself. This | 267 // to check the version information in the DLL itself. This |
| 267 // will be a string of the format: <type1>|<type2>|<type3>|... | 268 // will be a string of the format: <type1>|<type2>|<type3>|... |
| 268 // For example: | 269 // For example: |
| 269 // video/quicktime|audio/aiff|image/jpeg | 270 // video/quicktime|audio/aiff|image/jpeg |
| 270 scoped_ptr<FileVersionInfo> version_info( | 271 scoped_ptr<FileVersionInfo> version_info( |
| 271 FileVersionInfo::CreateFileVersionInfo(filename)); | 272 FileVersionInfo::CreateFileVersionInfo(filename)); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 | 455 |
| 455 #if !defined(ARCH_CPU_X86_64) | 456 #if !defined(ARCH_CPU_X86_64) |
| 456 // The plugin in question could be a 64 bit plugin which we cannot load. | 457 // The plugin in question could be a 64 bit plugin which we cannot load. |
| 457 base::FilePath plugin_path(info.path); | 458 base::FilePath plugin_path(info.path); |
| 458 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) | 459 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) |
| 459 return false; | 460 return false; |
| 460 #endif | 461 #endif |
| 461 return true; | 462 return true; |
| 462 } | 463 } |
| 463 | 464 |
| 464 } // namespace npapi | 465 } // namespace content |
| 465 } // namespace webkit | |
| OLD | NEW |