summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhorwich@chromium.org <jhorwich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-14 20:36:12 +0000
committerjhorwich@chromium.org <jhorwich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-14 20:36:12 +0000
commit60e7ebc2e5077f2d014423f2603cabd774a6b0a6 (patch)
tree3cfba953e852079efafbdf784ddb991274bbea9d
parent56c7cb1f1d56673d09b17581aa7265f21cf25b0a (diff)
downloadchromium_src-60e7ebc2e5077f2d014423f2603cabd774a6b0a6.zip
chromium_src-60e7ebc2e5077f2d014423f2603cabd774a6b0a6.tar.gz
chromium_src-60e7ebc2e5077f2d014423f2603cabd774a6b0a6.tar.bz2
Register O3D/GTalk PPAPI plugins if available
BUG=97848 TEST=manual. Check chrome:plugins, run gtalk if plugins available Review URL: http://codereview.chromium.org/8899014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114487 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/chrome_content_client.cc46
-rw-r--r--chrome/common/chrome_paths.cc20
-rw-r--r--chrome/common/chrome_paths.h2
3 files changed, 68 insertions, 0 deletions
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index da07553..12a3d02 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -51,6 +51,16 @@ const char kNaClPluginDescription[] = "Native Client Executable";
const char kNaClOldPluginName[] = "Chrome NaCl";
+const char kO3DPluginName[] = "Google Talk Plugin Video Accelerator";
+const char kO3DPluginMimeType[] ="application/vnd.o3d.auto";
+const char kO3DPluginExtension[] = "";
+const char kO3DPluginDescription[] = "O3D MIME";
+
+const char kGTalkPluginName[] = "Google Talk Plugin";
+const char kGTalkPluginMimeType[] ="application/googletalk";
+const char kGTalkPluginExtension[] = ".googletalk";
+const char kGTalkPluginDescription[] = "Google Talk Plugin";
+
#if defined(ENABLE_REMOTING)
const char kRemotingViewerPluginName[] = "Remoting Viewer";
const FilePath::CharType kRemotingViewerPluginPath[] =
@@ -117,6 +127,42 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
}
}
+ static bool skip_o3d_file_check = false;
+ if (PathService::Get(chrome::FILE_O3D_PLUGIN, &path)) {
+ if (skip_o3d_file_check || file_util::PathExists(path)) {
+ content::PepperPluginInfo o3d;
+ o3d.path = path;
+ o3d.name = kO3DPluginName;
+ o3d.is_out_of_process = true;
+ o3d.is_sandboxed = false;
+ webkit::WebPluginMimeType o3d_mime_type(kO3DPluginMimeType,
+ kO3DPluginExtension,
+ kO3DPluginDescription);
+ o3d.mime_types.push_back(o3d_mime_type);
+ plugins->push_back(o3d);
+
+ skip_o3d_file_check = true;
+ }
+ }
+
+ static bool skip_gtalk_file_check = false;
+ if (PathService::Get(chrome::FILE_GTALK_PLUGIN, &path)) {
+ if (skip_gtalk_file_check || file_util::PathExists(path)) {
+ content::PepperPluginInfo gtalk;
+ gtalk.path = path;
+ gtalk.name = kGTalkPluginName;
+ gtalk.is_out_of_process = true;
+ gtalk.is_sandboxed = false;
+ webkit::WebPluginMimeType gtalk_mime_type(kGTalkPluginMimeType,
+ kGTalkPluginExtension,
+ kGTalkPluginDescription);
+ gtalk.mime_types.push_back(gtalk_mime_type);
+ plugins->push_back(gtalk);
+
+ skip_gtalk_file_check = true;
+ }
+ }
+
// The Remoting Viewer plugin is built-in.
#if defined(ENABLE_REMOTING)
content::PepperPluginInfo info;
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index 5af2ce3..e2f1019 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -60,6 +60,16 @@ const FilePath::CharType kInternalNaClHelperBootstrapFileName[] =
FILE_PATH_LITERAL("nacl_helper_bootstrap");
#endif
+
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+
+const FilePath::CharType kO3DPluginFileName[] =
+ FILE_PATH_LITERAL("pepper/libppo3dautoplugin.so");
+
+const FilePath::CharType kGTalkPluginFileName[] =
+ FILE_PATH_LITERAL("pepper/libppgoogletalk.so");
+
+#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
} // namespace
namespace chrome {
@@ -253,6 +263,16 @@ bool PathProvider(int key, FilePath* result) {
return false;
cur = cur.Append(kInternalNaClHelperBootstrapFileName);
break;
+ case chrome::FILE_O3D_PLUGIN:
+ if (!PathService::Get(base::DIR_MODULE, &cur))
+ return false;
+ cur = cur.Append(kO3DPluginFileName);
+ break;
+ case chrome::FILE_GTALK_PLUGIN:
+ if (!PathService::Get(base::DIR_MODULE, &cur))
+ return false;
+ cur = cur.Append(kGTalkPluginFileName);
+ break;
#endif
case chrome::FILE_RESOURCES_PACK:
#if defined(OS_MACOSX)
diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h
index c6edfb3..6de62b9 100644
--- a/chrome/common/chrome_paths.h
+++ b/chrome/common/chrome_paths.h
@@ -84,6 +84,8 @@ enum {
FILE_NACL_HELPER_BOOTSTRAP, // ... and nacl_helper_bootstrap executable.
#endif
FILE_NACL_PLUGIN, // Full path to the internal NaCl plugin file.
+ FILE_O3D_PLUGIN, // Full path to the O3D Pepper plugin file.
+ FILE_GTALK_PLUGIN, // Full path to the GTalk Pepper plugin file.
FILE_LIBAVCODEC, // Full path to libavcodec media decoding
// library.
FILE_LIBAVFORMAT, // Full path to libavformat media parsing