diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 18:01:42 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 18:01:42 +0000 |
commit | dfb677fbfb8712185adda2834c1361ce9d48d134 (patch) | |
tree | 3f8a34b6b6d554f904d7509e104bad29b4ba76a6 /chrome/common | |
parent | 214acd9b2f2fd83401d54d86b31fe4bf577cdf56 (diff) | |
download | chromium_src-dfb677fbfb8712185adda2834c1361ce9d48d134.zip chromium_src-dfb677fbfb8712185adda2834c1361ce9d48d134.tar.gz chromium_src-dfb677fbfb8712185adda2834c1361ce9d48d134.tar.bz2 |
Added paths for internal plugins.
BUG=none
TEST=none (but Gears should continue to work on Windows)
Review URL: http://codereview.chromium.org/1340001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_paths.cc | 34 | ||||
-rw-r--r-- | chrome/common/chrome_paths.h | 4 |
2 files changed, 36 insertions, 2 deletions
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 32dd883..2095863 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -18,8 +18,33 @@ #include "base/mac_util.h" #endif +namespace { + +// File name of the internal Flash plugin on different platforms. +const 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 + +} // namespace + namespace chrome { +// Gets the path for internal (or bundled) plugins. +bool GetInternalPluginsDirectory(FilePath* result) { +#if defined(OS_MACOSX) + *result = chrome::GetVersionedDirectory(); + DCHECK(!result->empty()); + return true; +#else + return PathService::Get(base::DIR_MODULE, result); +#endif +} + bool GetGearsPluginPathFromCommandLine(FilePath* path) { #ifndef NDEBUG // for debugging, support a cmd line based override @@ -167,7 +192,7 @@ bool PathProvider(int key, FilePath* result) { // Search for gears.dll alongside chrome.dll first. This new model // allows us to package gears.dll with the Chrome installer and update // it while Chrome is running. - if (!PathService::Get(base::DIR_MODULE, &cur)) + if (!GetInternalPluginsDirectory(&cur)) return false; cur = cur.Append(FILE_PATH_LITERAL("gears.dll")); @@ -184,6 +209,13 @@ bool PathProvider(int key, FilePath* result) { #endif } break; + case chrome::FILE_FLASH_PLUGIN: + if (!GetInternalPluginsDirectory(&cur)) + return false; + cur = cur.Append(kInternalFlashPluginFileName); + if (!file_util::PathExists(cur)) + return false; + break; #if defined(OS_CHROMEOS) case chrome::FILE_CHROMEOS_API: if (!PathService::Get(base::DIR_MODULE, &cur)) diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index 7a75c9d..d6aed60 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h @@ -36,8 +36,10 @@ enum { FILE_LOCAL_STATE, // Path and filename to the file in which // machine/installation-specific state is saved. FILE_RECORDED_SCRIPT, // Full path to the script.log file that - // contains recorded browser events for playback. + // contains recorded browser events for + // playback. FILE_GEARS_PLUGIN, // Full path to the gears.dll plugin file. + FILE_FLASH_PLUGIN, // Full path to the internal Flash plugin file. FILE_LIBAVCODEC, // Full path to libavcodec media decoding // library. FILE_LIBAVFORMAT, // Full path to libavformat media parsing |