summaryrefslogtreecommitdiff
path: root/indra/newview/llmediactrl.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-05-21 15:36:12 -0700
committerMonroe Linden <monroe@lindenlab.com>2010-05-21 15:36:12 -0700
commit79f697ad513525893fe9ebab62bf2a61186342ec (patch)
treefc203ae6963505a4f190eb89cf83c9730da897c2 /indra/newview/llmediactrl.cpp
parent9add3aa8cb60b925fcc50e333ac7d5afd5522df1 (diff)
Fix for EXT-5667 (support window.open() in shared media so google docs will work).
Moved the processing of clicks on _external and _blank targeted links from LLMediaCtrl to LLViewerMediaImpl. Removed LLMediaCtrl::setOpenInExternalBrowser() since that functionality is available through the use of the _external target attribute in web content. Removed LLMediaCtrl:: setOpenInInternalBrowser() since it was unimplemented and not used. Made the webkit media plugin set llqtwebkit's window open behavior to WOB_SIMULATE_BLANK_HREF_CLICK. This is #ifdefed out on Linux until we get a new Linux build of llqtwebkit.
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r--indra/newview/llmediactrl.cpp106
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;