Index: chrome/common/chrome_paths.cc |
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc |
index b48092b758a9cf0af129115c7164cce50a84e551..ed7cdfb759656f6197103a108f4d7019f5d0f90b 100644 |
--- a/chrome/common/chrome_paths.cc |
+++ b/chrome/common/chrome_paths.cc |
@@ -35,22 +35,6 @@ |
namespace { |
-#if defined(OS_WIN) |
-const wchar_t kFlashRegistryRoot[] = L"SOFTWARE\\Macromedia\\FlashPlayerPepper"; |
- |
-const wchar_t kFlashPlayerPathValueName[] = L"PlayerPath"; |
-#endif |
- |
-// File name of the internal Flash plugin on different platforms. |
-const base::FilePath::CharType kInternalFlashPluginFileName[] = |
-#if defined(OS_MACOSX) |
- FILE_PATH_LITERAL("Flash Player Plugin for Chrome.plugin"); |
-#elif defined(OS_WIN) |
- FILE_PATH_LITERAL("gcswf32.dll"); |
-#else // OS_LINUX, etc. |
- FILE_PATH_LITERAL("libgcflashplayer.so"); |
-#endif |
- |
// The Pepper Flash plugins are in a directory with this name. |
const base::FilePath::CharType kPepperFlashBaseDirectory[] = |
FILE_PATH_LITERAL("PepperFlash"); |
@@ -58,6 +42,10 @@ const base::FilePath::CharType kPepperFlashBaseDirectory[] = |
#if defined(OS_MACOSX) && !defined(OS_IOS) |
const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] = |
FILE_PATH_LITERAL("Internet Plug-Ins/PepperFlashPlayer"); |
+const base::FilePath::CharType kFlashSystemBaseDirectory[] = |
+ FILE_PATH_LITERAL("Internet Plug-Ins"); |
+const base::FilePath::CharType kFlashSystemPluginName[] = |
+ FILE_PATH_LITERAL("Flash Player.plugin"); |
#endif |
const base::FilePath::CharType kInternalNaClPluginFileName[] = |
@@ -96,15 +84,23 @@ bool GetInternalPluginsDirectory(base::FilePath* result) { |
} |
#if defined(OS_WIN) |
-// Gets the Flash path if installed on the system. |
-bool GetSystemFlashDirectory(base::FilePath* out_path) { |
- base::win::RegKey path_key(HKEY_LOCAL_MACHINE, kFlashRegistryRoot, KEY_READ); |
+// Gets the Flash path if installed on the system. |is_npapi| determines whether |
+// to return the NPAPI of the PPAPI version of the system plugin. |
+bool GetSystemFlashFilename(base::FilePath* out_path, bool is_npapi) { |
+ const wchar_t kNpapiFlashRegistryRoot[] = |
+ L"SOFTWARE\\Macromedia\\FlashPlayerPlugin"; |
+ const wchar_t kPepperFlashRegistryRoot[] = |
+ L"SOFTWARE\\Macromedia\\FlashPlayerPepper"; |
+ const wchar_t kFlashPlayerPathValueName[] = L"PlayerPath"; |
+ |
+ base::win::RegKey path_key( |
+ HKEY_LOCAL_MACHINE, |
+ is_npapi ? kNpapiFlashRegistryRoot : kPepperFlashRegistryRoot, KEY_READ); |
base::string16 path_str; |
if (FAILED(path_key.ReadValue(kFlashPlayerPathValueName, &path_str))) |
return false; |
- base::FilePath plugin_path = base::FilePath(path_str).DirName(); |
- *out_path = plugin_path; |
+ *out_path = base::FilePath(path_str); |
return true; |
} |
#endif |
@@ -270,20 +266,35 @@ bool PathProvider(int key, base::FilePath* result) { |
return false; |
cur = cur.Append(kPepperFlashBaseDirectory); |
break; |
- case chrome::DIR_PEPPER_FLASH_SYSTEM_PLUGIN: |
+ case chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN: |
#if defined(OS_WIN) |
- if (!GetSystemFlashDirectory(&cur)) |
+ if (!GetSystemFlashFilename(&cur, false)) |
return false; |
#elif defined(OS_MACOSX) && !defined(OS_IOS) |
if (!GetLocalLibraryDirectory(&cur)) |
return false; |
cur = cur.Append(kPepperFlashSystemBaseDirectory); |
+ cur = cur.Append(chrome::kPepperFlashPluginFilename); |
#else |
// Chrome on iOS does not supports PPAPI binaries, return false. |
// TODO(wfh): If Adobe release PPAPI binaries for Linux, add support here. |
return false; |
#endif |
break; |
+ case chrome::FILE_FLASH_SYSTEM_PLUGIN: |
+#if defined(OS_WIN) |
+ if (!GetSystemFlashFilename(&cur, true)) |
+ return false; |
+#elif defined(OS_MACOSX) && !defined(OS_IOS) |
+ if (!GetLocalLibraryDirectory(&cur)) |
+ return false; |
+ cur = cur.Append(kFlashSystemBaseDirectory); |
+ cur = cur.Append(kFlashSystemPluginName); |
+#else |
+ // Chrome on other platforms does not supports system NPAPI binaries. |
+ return false; |
+#endif |
+ break; |
case chrome::FILE_LOCAL_STATE: |
if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
return false; |
@@ -294,11 +305,6 @@ bool PathProvider(int key, base::FilePath* result) { |
return false; |
cur = cur.Append(FILE_PATH_LITERAL("script.log")); |
break; |
- case chrome::FILE_FLASH_PLUGIN: |
- if (!GetInternalPluginsDirectory(&cur)) |
- return false; |
- cur = cur.Append(kInternalFlashPluginFileName); |
- break; |
case chrome::FILE_PEPPER_FLASH_PLUGIN: |
if (!PathService::Get(chrome::DIR_PEPPER_FLASH_PLUGIN, &cur)) |
return false; |