summaryrefslogtreecommitdiff
path: root/indra/media_plugins/webkit/media_plugin_webkit.cpp
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-22 13:10:59 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-22 13:10:59 -0700
commitb8ce05ed08a7db0825c04c217888814ef523027a (patch)
treecae04332048f649e1280d3bdc3d20f46df773e67 /indra/media_plugins/webkit/media_plugin_webkit.cpp
parente5484e56b3c13e65bd31d7bf21c1cd3a2d9333f2 (diff)
parenta464d469705aeae57fcdbfafa45e2bf592a182c5 (diff)
merge
Diffstat (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp')
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp49
1 files changed, 47 insertions, 2 deletions
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)