summaryrefslogtreecommitdiff
path: root/indra/media_plugins/webkit
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-19 12:57:25 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-19 12:57:25 -0700
commit9fc74de1a18bbb209ee2524b0c833b3016ffc5e3 (patch)
tree134b4ef690e12793dbfe60167625b65dcec6e996 /indra/media_plugins/webkit
parent0d6f1d125eb0f6de766d617978a022fc74b4aec7 (diff)
parent909e784deb73d1da73928448cddb219af42ada93 (diff)
merge
Diffstat (limited to 'indra/media_plugins/webkit')
-rw-r--r--indra/media_plugins/webkit/CMakeLists.txt8
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp49
2 files changed, 55 insertions, 2 deletions
diff --git a/indra/media_plugins/webkit/CMakeLists.txt b/indra/media_plugins/webkit/CMakeLists.txt
index d96477279d..5bccd589d8 100644
--- a/indra/media_plugins/webkit/CMakeLists.txt
+++ b/indra/media_plugins/webkit/CMakeLists.txt
@@ -52,6 +52,14 @@ add_dependencies(media_plugin_webkit
${LLCOMMON_LIBRARIES}
)
+if (WINDOWS)
+ set_target_properties(
+ media_plugin_webkit
+ PROPERTIES
+ LINK_FLAGS "/MANIFEST:NO"
+ )
+endif (WINDOWS)
+
if (DARWIN)
# Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name
set_target_properties(
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index eb2457744a..65872e1596 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -48,6 +48,18 @@
#include <stdlib.h>
#endif
+#if LL_WINDOWS
+ // *NOTE:Mani - This captures the module handle fo rthe dll. This is used below
+ // to get the path to this dll for webkit initialization.
+ // I don't know how/if this can be done with apr...
+ namespace { HMODULE gModuleHandle;};
+ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+ {
+ gModuleHandle = (HMODULE) hinstDLL;
+ return TRUE;
+ }
+#endif
+
////////////////////////////////////////////////////////////////////////////////
//
class MediaPluginWebKit :
@@ -126,7 +138,31 @@ private:
return false;
}
std::string application_dir = std::string( cwd );
+
+#if LL_WINDOWS
+ //*NOTE:Mani - On windows, at least, the component path is the
+ // location of this dll's image file.
+ std::string component_dir;
+ char dll_path[_MAX_PATH];
+ DWORD len = GetModuleFileNameA(gModuleHandle, (LPCH)&dll_path, _MAX_PATH);
+ while(len && dll_path[ len ] != ('\\') )
+ {
+ len--;
+ }
+ if(len >= 0)
+ {
+ dll_path[len] = 0;
+ component_dir = dll_path;
+ }
+ else
+ {
+ // *NOTE:Mani - This case should be an rare exception.
+ // GetModuleFileNameA should always give you a full path, no?
+ component_dir = application_dir;
+ }
+#else
std::string component_dir = application_dir;
+#endif
std::string profileDir = application_dir + "/" + "browser_profile"; // cross platform?
// window handle - needed on Windows and must be app window.
@@ -147,7 +183,7 @@ private:
#if LL_WINDOWS
// Enable plugins
- LLQtWebKit::getInstance()->enablePlugins(false);
+ LLQtWebKit::getInstance()->enablePlugins(true);
#elif LL_DARWIN
// Disable plugins
LLQtWebKit::getInstance()->enablePlugins(false);
@@ -272,7 +308,16 @@ private:
message.setValue("status", event.getStringValue());
sendMessage(message);
}
-
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // virtual
+ void onTitleChange(const EventType& event)
+ {
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text");
+ message.setValue("name", event.getStringValue());
+ sendMessage(message);
+ }
+
////////////////////////////////////////////////////////////////////////////////
// virtual
void onLocationChange(const EventType& event)