summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-05-27 18:28:31 -0700
committerRichard Linden <none@none>2010-05-27 18:28:31 -0700
commit8ec4f45daa93ca1acc5e45df2def1b84397127e8 (patch)
tree2e26a689b8ac4fe64eae59e6596aa29782ae77fb /indra/newview/llviewermedia.cpp
parent64ba7744e66b2685a5377c01c6715533bc00564a (diff)
parent68ca9dc95729d9659b8318898dcbd1c813aca678 (diff)
merge
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp66
1 files changed, 16 insertions, 50 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index e5c5a607dd..14e58f4167 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2795,42 +2795,6 @@ bool LLViewerMediaImpl::isPlayable() const
return false;
}
-////////////////////////////////////////////////////////////////////////////////
-// static
-bool LLViewerMediaImpl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response )
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if ( 0 == option )
- {
- LLSD payload = notification["payload"];
- std::string url = payload["url"].asString();
- S32 target_type = payload["target_type"].asInteger();
- clickLinkWithTarget(url, target_type);
- }
- return false;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// static
-void LLViewerMediaImpl::clickLinkWithTarget(const std::string& url, const S32& target_type )
-{
- if (target_type == LLPluginClassMedia::TARGET_EXTERNAL)
- {
- // load target in an external browser
- LLWeb::loadURLExternal(url);
- }
- else if (target_type == LLPluginClassMedia::TARGET_BLANK)
- {
- // load target in the user's preferred browser
- LLWeb::loadURL(url);
- }
- else {
- // unsupported link target - shouldn't happen
- LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL;
- }
-}
-
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent event)
{
@@ -2851,21 +2815,23 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
std::string url = plugin->getClickURL();
U32 target_type = plugin->getClickTargetType();
- // is there is a target specified for the link?
- if (target_type == LLPluginClassMedia::TARGET_EXTERNAL ||
- target_type == LLPluginClassMedia::TARGET_BLANK )
+ switch (target_type)
{
- if (gSavedSettings.getBOOL("UseExternalBrowser"))
- {
- LLSD payload;
- payload["url"] = url;
- payload["target_type"] = LLSD::Integer(target_type);
- LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget);
- }
- else
- {
- clickLinkWithTarget(url, target_type);
- }
+ case LLPluginClassMedia::TARGET_EXTERNAL:
+ // force url to external browser
+ LLWeb::loadURLExternal(url);
+ break;
+ case LLPluginClassMedia::TARGET_BLANK:
+ // open in SL media browser or external browser based on user pref
+ LLWeb::loadURL(url);
+ break;
+ case LLPluginClassMedia::TARGET_NONE:
+ // ignore this click and let media plugin handle it
+ break;
+ case LLPluginClassMedia::TARGET_OTHER:
+ LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL;
+ break;
+ default: break;
}
};
break;