diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-22 09:04:42 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-22 09:04:42 +0100 |
commit | eeba10255bf41dfe50b975ded16a9fe9c30e4025 (patch) | |
tree | 3f56f1e991aa007bd6a4f1d9784416fcbfb29fd7 /indra/newview/llmediactrl.cpp | |
parent | c73bb0ae17538c0cb509bf6f0945a29c0ffd69dc (diff) | |
parent | 28d4fe68f8a44924df294473471b47ccb11a2eb1 (diff) |
merge from viewer-public
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 05cb6ddc4a..7a4ed74c4c 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -78,8 +78,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mBorder(NULL), mFrequentUpdates( true ), mForceUpdate( false ), - mOpenLinksInExternalBrowser( false ), - mOpenLinksInInternalBrowser( false ), mHomePageUrl( "" ), mTrusted(false), mIgnoreUIScale( true ), @@ -167,20 +165,6 @@ void LLMediaCtrl::setTakeFocusOnClick( bool take_focus ) } //////////////////////////////////////////////////////////////////////////////// -// set flag that forces the embedded browser to open links in the external system browser -void LLMediaCtrl::setOpenInExternalBrowser( bool valIn ) -{ - mOpenLinksInExternalBrowser = valIn; -}; - -//////////////////////////////////////////////////////////////////////////////// -// set flag that forces the embedded browser to open links in the internal browser floater -void LLMediaCtrl::setOpenInInternalBrowser( bool valIn ) -{ - mOpenLinksInInternalBrowser = valIn; -}; - -//////////////////////////////////////////////////////////////////////////////// void LLMediaCtrl::setTrusted( bool valIn ) { if(mMediaSource) @@ -944,7 +928,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) case MEDIA_EVENT_CLICK_LINK_HREF: { LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL; - onClickLinkHref(self); }; break; @@ -979,95 +962,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) //////////////////////////////////////////////////////////////////////////////// // -void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) -{ - // retrieve the event parameters - std::string url = self->getClickURL(); - U32 target_type = self->getClickTargetType(); - - // is there is a target specified for the link? - if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || - target_type == LLPluginClassMedia::TARGET_BLANK ) - { - 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); - } - } - else { - const std::string protocol1( "http://" ); - const std::string protocol2( "https://" ); - if( mOpenLinksInExternalBrowser ) - { - if ( !url.empty() ) - { - if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 || - LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 ) - { - LLWeb::loadURLExternal( url ); - } - } - } - else - if( mOpenLinksInInternalBrowser ) - { - if ( !url.empty() ) - { - if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 || - LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 ) - { - llwarns << "Dead, unimplemented path that we used to send to the built-in browser long ago." << llendl; - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -// static -bool LLMediaCtrl::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 LLMediaCtrl::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; - } -} - -//////////////////////////////////////////////////////////////////////////////// -// std::string LLMediaCtrl::getCurrentNavUrl() { return mCurrentNavUrl; |