summaryrefslogtreecommitdiffstats
path: root/chrome/common/chrome_plugin_lib.cc
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 22:58:52 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 22:58:52 +0000
commitefb07436b9ba4737247cdf0e8ba0529e27942468 (patch)
tree8a96f13f3af49c7c15efe3e3db3e1727100f52de /chrome/common/chrome_plugin_lib.cc
parent39354f413433746b7f35135f85c1940210324eff (diff)
downloadchromium_src-efb07436b9ba4737247cdf0e8ba0529e27942468.zip
chromium_src-efb07436b9ba4737247cdf0e8ba0529e27942468.tar.gz
chromium_src-efb07436b9ba4737247cdf0e8ba0529e27942468.tar.bz2
Changes to make it possible to statically link Gears. This is disabled by an
#ifdef. This only partially works. Missing pieces: - gears resources for HTML dialogs (permissions, shortcut, settings). - able to compile with a non-official gears build. Review URL: http://codereview.chromium.org/18299 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_plugin_lib.cc')
-rw-r--r--chrome/common/chrome_plugin_lib.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc
index 0f4b4e6..4af7a558 100644
--- a/chrome/common/chrome_plugin_lib.cc
+++ b/chrome/common/chrome_plugin_lib.cc
@@ -36,6 +36,12 @@ static PluginMap* g_loaded_libs;
static DWORD g_plugin_thread_id = 0;
static MessageLoop* g_plugin_thread_loop = NULL;
+#ifdef GEARS_STATIC_LIB
+// defined in gears/base/chrome/module_cr.cc
+CPError STDCALL Gears_CP_Initialize(CPID id, const CPBrowserFuncs *bfuncs,
+ CPPluginFuncs *pfuncs);
+#endif
+
static bool IsSingleProcessMode() {
// We don't support ChromePlugins in single-process mode.
CommandLine command_line;
@@ -231,6 +237,14 @@ int ChromePluginLib::CP_Test(void* param) {
bool ChromePluginLib::Load() {
DCHECK(module_ == 0);
+#ifdef GEARS_STATIC_LIB
+ FilePath path;
+ if (filename_.BaseName().value().find(FILE_PATH_LITERAL("gears")) == 0) {
+ CP_Initialize_ = &Gears_CP_Initialize;
+ return true;
+ }
+#endif
+
module_ = LoadLibrary(filename_.value().c_str());
if (module_ == 0)
return false;