diff options
author | Roxie Linden <roxie@lindenlab.com> | 2010-05-27 21:48:20 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2010-05-27 21:48:20 -0700 |
commit | d7144e76bf134897fca31cb6ac91b7894dc02ae3 (patch) | |
tree | 977248539a4f56d07139dcc59e1daf072310bb42 /indra/newview/llviewermedia.cpp | |
parent | e44d0254af990b659a281cf0020cd06a3931bd77 (diff) | |
parent | 8ec4f45daa93ca1acc5e45df2def1b84397127e8 (diff) |
automated merge
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 66 |
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; |