summaryrefslogtreecommitdiff
path: root/indra/llplugin/llpluginclassmedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llplugin/llpluginclassmedia.cpp')
-rw-r--r--indra/llplugin/llpluginclassmedia.cpp55
1 files changed, 34 insertions, 21 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index dcbe97469b..69ed0fb09c 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -74,6 +74,7 @@ bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::s
// Queue up the media init message -- it will be sent after all the currently queued messages.
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "init");
+ message.setValue("target", mTarget);
sendMessage(message);
mPlugin->init(launcher_filename, plugin_filename, debug);
@@ -143,7 +144,7 @@ void LLPluginClassMedia::reset()
mProgressPercent = 0;
mClickURL.clear();
mClickTarget.clear();
- mClickTargetType = TARGET_NONE;
+ mClickUUID.clear();
// media_time class
mCurrentTime = 0.0f;
@@ -727,24 +728,9 @@ void LLPluginClassMedia::setJavascriptEnabled(const bool enabled)
sendMessage(message);
}
-LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type)
+void LLPluginClassMedia::setTarget(const std::string &target)
{
- // convert a LinkTargetType value from llqtwebkit to an ETargetType
- // so that we don't expose the llqtwebkit header in viewer code
- switch (target_type)
- {
- case LLQtWebKit::LTT_TARGET_NONE:
- return LLPluginClassMedia::TARGET_NONE;
-
- case LLQtWebKit::LTT_TARGET_BLANK:
- return LLPluginClassMedia::TARGET_BLANK;
-
- case LLQtWebKit::LTT_TARGET_EXTERNAL:
- return LLPluginClassMedia::TARGET_EXTERNAL;
-
- default:
- return LLPluginClassMedia::TARGET_OTHER;
- }
+ mTarget = target;
}
/* virtual */
@@ -1003,15 +989,13 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
{
mClickURL = message.getValue("uri");
mClickTarget = message.getValue("target");
- U32 target_type = message.getValueU32("target_type");
- mClickTargetType = ::getTargetTypeFromLLQtWebkit(target_type);
+ mClickUUID = message.getValue("uuid");
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF);
}
else if(message_name == "click_nofollow")
{
mClickURL = message.getValue("uri");
mClickTarget.clear();
- mClickTargetType = TARGET_NONE;
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW);
}
else if(message_name == "cookie_set")
@@ -1025,6 +1009,16 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
{
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLOSE_REQUEST);
}
+ else if(message_name == "geometry_change")
+ {
+ mClickUUID = message.getValue("uuid");
+ mGeometryX = message.getValueS32("x");
+ mGeometryY = message.getValueS32("y");
+ mGeometryWidth = message.getValueS32("width");
+ mGeometryHeight = message.getValueS32("height");
+
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_GEOMETRY_CHANGE);
+ }
else
{
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
@@ -1179,6 +1173,25 @@ void LLPluginClassMedia::setBrowserUserAgent(const std::string& user_agent)
sendMessage(message);
}
+void LLPluginClassMedia::proxyWindowOpened(const std::string &target, const std::string &uuid)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_opened");
+
+ message.setValue("target", target);
+ message.setValue("uuid", uuid);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::proxyWindowClosed(const std::string &uuid)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_closed");
+
+ message.setValue("uuid", uuid);
+
+ sendMessage(message);
+}
+
void LLPluginClassMedia::crashPlugin()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "crash");