diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llwebbrowserctrl.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp index 8649515..858c88c 100644 --- a/linden/indra/newview/llwebbrowserctrl.cpp +++ b/linden/indra/newview/llwebbrowserctrl.cpp | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -62,8 +62,7 @@ LLWebBrowserCtrl::LLWebBrowserCtrl( const std::string& name, const LLRect& rect | |||
62 | mFrequentUpdates( true ), | 62 | mFrequentUpdates( true ), |
63 | mOpenLinksInExternalBrowser( false ), | 63 | mOpenLinksInExternalBrowser( false ), |
64 | mOpenLinksInInternalBrowser( false ), | 64 | mOpenLinksInInternalBrowser( false ), |
65 | mOpenSLURLsInMap( true ), | 65 | mOpenAppSLURLs( false ), |
66 | mOpenSLURLsViaTeleport( false ), | ||
67 | mHomePageUrl( "" ), | 66 | mHomePageUrl( "" ), |
68 | mIgnoreUIScale( true ), | 67 | mIgnoreUIScale( true ), |
69 | mAlwaysRefresh( false ) | 68 | mAlwaysRefresh( false ) |
@@ -154,17 +153,9 @@ void LLWebBrowserCtrl::setOpenInInternalBrowser( bool valIn ) | |||
154 | }; | 153 | }; |
155 | 154 | ||
156 | //////////////////////////////////////////////////////////////////////////////// | 155 | //////////////////////////////////////////////////////////////////////////////// |
157 | // open secondlife:// links in map automatically or not | 156 | void LLWebBrowserCtrl::setOpenAppSLURLs( bool valIn ) |
158 | void LLWebBrowserCtrl::setOpenSLURLsInMap( bool valIn ) | ||
159 | { | 157 | { |
160 | mOpenSLURLsInMap = valIn; | 158 | mOpenAppSLURLs = valIn; |
161 | }; | ||
162 | |||
163 | //////////////////////////////////////////////////////////////////////////////// | ||
164 | // teleport directly to secondlife:// links | ||
165 | void LLWebBrowserCtrl::setOpenSLURLsViaTeleport( bool valIn ) | ||
166 | { | ||
167 | mOpenSLURLsViaTeleport = valIn; | ||
168 | }; | 159 | }; |
169 | 160 | ||
170 | //////////////////////////////////////////////////////////////////////////////// | 161 | //////////////////////////////////////////////////////////////////////////////// |
@@ -603,7 +594,8 @@ void LLWebBrowserCtrl::onLocationChange( const EventType& eventIn ) | |||
603 | std::string redirect_http_hack = queryMap["redirect-http-hack"].asString(); | 594 | std::string redirect_http_hack = queryMap["redirect-http-hack"].asString(); |
604 | if (!redirect_http_hack.empty()) | 595 | if (!redirect_http_hack.empty()) |
605 | { | 596 | { |
606 | LLURLDispatcher::dispatch(redirect_http_hack); | 597 | const bool from_external_browser = false; |
598 | LLURLDispatcher::dispatch(redirect_http_hack, from_external_browser); | ||
607 | return; | 599 | return; |
608 | } | 600 | } |
609 | 601 | ||
@@ -634,7 +626,13 @@ void LLWebBrowserCtrl::onClickLinkHref( const EventType& eventIn ) | |||
634 | { | 626 | { |
635 | if ( LLString::compareInsensitive( eventIn.getStringValue().substr( 0, protocol.length() ).c_str(), protocol.c_str() ) == 0 ) | 627 | if ( LLString::compareInsensitive( eventIn.getStringValue().substr( 0, protocol.length() ).c_str(), protocol.c_str() ) == 0 ) |
636 | { | 628 | { |
637 | LLFloaterHtml::getInstance()->show( eventIn.getStringValue(), "Second Life Browser"); | 629 | // If we spawn a new LLFloaterHTML, assume we want it to |
630 | // follow this LLWebBrowserCtrl's setting for whether or | ||
631 | // not to open secondlife:///app/ links. JC. | ||
632 | LLFloaterHtml::getInstance()->show( | ||
633 | eventIn.getStringValue(), | ||
634 | "Second Life Browser", | ||
635 | mOpenAppSLURLs); | ||
638 | }; | 636 | }; |
639 | }; | 637 | }; |
640 | }; | 638 | }; |
@@ -649,7 +647,15 @@ void LLWebBrowserCtrl::onClickLinkHref( const EventType& eventIn ) | |||
649 | void LLWebBrowserCtrl::onClickLinkSecondLife( const EventType& eventIn ) | 647 | void LLWebBrowserCtrl::onClickLinkSecondLife( const EventType& eventIn ) |
650 | { | 648 | { |
651 | std::string url = eventIn.getStringValue(); | 649 | std::string url = eventIn.getStringValue(); |
652 | LLURLDispatcher::dispatch(url); | 650 | if (LLURLDispatcher::isSLURLCommand(url) |
651 | && !mOpenAppSLURLs) | ||
652 | { | ||
653 | // block handling of this secondlife:///app/ URL | ||
654 | return; | ||
655 | } | ||
656 | |||
657 | const bool from_external_browser = false; | ||
658 | LLURLDispatcher::dispatch(url, from_external_browser); | ||
653 | 659 | ||
654 | // chain this event on to observers of an instance of LLWebBrowserCtrl | 660 | // chain this event on to observers of an instance of LLWebBrowserCtrl |
655 | LLWebBrowserCtrlEvent event( eventIn.getStringValue() ); | 661 | LLWebBrowserCtrlEvent event( eventIn.getStringValue() ); |