summaryrefslogtreecommitdiff
path: root/indra/llplugin/llpluginclassmedia.cpp
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2010-01-14 18:42:29 +0000
committerLynx Linden <lynx@lindenlab.com>2010-01-14 18:42:29 +0000
commitbe8e6100a7862bfcb91797db69e8f0d42fff9cd1 (patch)
treed44e43830f4fa21cf081ae3bbd6ad302d54690a5 /indra/llplugin/llpluginclassmedia.cpp
parent556d5b8d5fdd442241ff8d81f76f9794bd536716 (diff)
parentcaa9acaaed9c9be92c11002e1d09fbf3350ed0de (diff)
Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0
Diffstat (limited to 'indra/llplugin/llpluginclassmedia.cpp')
-rw-r--r--indra/llplugin/llpluginclassmedia.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index 69f19afdad..3d2eaed5c5 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -37,6 +37,8 @@
#include "llpluginclassmedia.h"
#include "llpluginmessageclasses.h"
+#include "llqtwebkit.h"
+
static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256;
static int nextPowerOf2( int value )
@@ -134,6 +136,9 @@ void LLPluginClassMedia::reset()
mHistoryForwardAvailable = false;
mStatusText.clear();
mProgressPercent = 0;
+ mClickURL.clear();
+ mClickTarget.clear();
+ mClickTargetType = TARGET_NONE;
// media_time class
mCurrentTime = 0.0f;
@@ -669,6 +674,26 @@ void LLPluginClassMedia::paste()
sendMessage(message);
}
+LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type)
+{
+ // 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 LinkTargetType::LTT_TARGET_NONE:
+ return LLPluginClassMedia::TARGET_NONE;
+
+ case LinkTargetType::LTT_TARGET_BLANK:
+ return LLPluginClassMedia::TARGET_BLANK;
+
+ case LinkTargetType::LTT_TARGET_EXTERNAL:
+ return LLPluginClassMedia::TARGET_EXTERNAL;
+
+ default:
+ return LLPluginClassMedia::TARGET_OTHER;
+ }
+}
+
/* virtual */
void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
{
@@ -921,12 +946,15 @@ 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);
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