diff options
author | Eli Linden <eli@lindenlab.com> | 2010-03-08 16:57:37 -0800 |
---|---|---|
committer | Eli Linden <eli@lindenlab.com> | 2010-03-08 16:57:37 -0800 |
commit | eaf1ad690890bae96f1de0ee0014f0c90db0b236 (patch) | |
tree | 7c8e13164288ff87202e5f31b1bf079ccaeeb84b /indra/newview | |
parent | 3f40ed40849ff21a7a023ca51d7778d50997345b (diff) | |
parent | c1b29dfcc253ebe1323824d31efd2d5db74f405d (diff) |
Merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llmediactrl.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelobjectinventory.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 4 |
5 files changed, 23 insertions, 15 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index bf33d8527e..05cb6ddc4a 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -80,8 +80,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mForceUpdate( false ), mOpenLinksInExternalBrowser( false ), mOpenLinksInInternalBrowser( false ), - mTrusted( false ), mHomePageUrl( "" ), + mTrusted(false), mIgnoreUIScale( true ), mAlwaysRefresh( false ), mMediaSource( 0 ), @@ -183,6 +183,10 @@ void LLMediaCtrl::setOpenInInternalBrowser( bool valIn ) //////////////////////////////////////////////////////////////////////////////// void LLMediaCtrl::setTrusted( bool valIn ) { + if(mMediaSource) + { + mMediaSource->setTrustedBrowser(valIn); + } mTrusted = valIn; } @@ -632,6 +636,7 @@ bool LLMediaCtrl::ensureMediaSourceExists() mMediaSource->setVisible( getVisible() ); mMediaSource->addObserver( this ); mMediaSource->setBackgroundColor( getBackgroundColor() ); + mMediaSource->setTrustedBrowser(mTrusted); if(mClearCache) { mMediaSource->clearCache(); @@ -946,7 +951,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) case MEDIA_EVENT_CLICK_LINK_NOFOLLOW: { LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is " << self->getClickURL() << LL_ENDL; - onClickLinkNoFollow(self); }; break; @@ -1064,15 +1068,6 @@ void LLMediaCtrl::clickLinkWithTarget(const std::string& url, const S32& target_ //////////////////////////////////////////////////////////////////////////////// // -void LLMediaCtrl::onClickLinkNoFollow( LLPluginClassMedia* self ) -{ - // let the dispatcher handle blocking/throttling of SLURLs - std::string url = self->getClickURL(); - LLURLDispatcher::dispatch(url, this, mTrusted); -} - -//////////////////////////////////////////////////////////////////////////////// -// std::string LLMediaCtrl::getCurrentNavUrl() { return mCurrentNavUrl; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 60e0c4073b..e55d2f7cd0 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -164,7 +164,6 @@ public: // handlers for individual events (could be done inside the switch in handleMediaEvent, they're just individual functions for clarity) void onClickLinkHref( LLPluginClassMedia* self ); - void onClickLinkNoFollow( LLPluginClassMedia* self ); protected: void convertInputCoords(S32& x, S32& y); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 5ddbdf7f01..6fcba80845 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -770,8 +770,8 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) { - LLInventoryItem* inv = NULL; - if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) + const LLInventoryItem *inv = dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mUUID)); + if (inv) { const LLPermissions& perm = inv->getPermissions(); bool can_copy = gAgent.allowOperation(PERM_COPY, perm, diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 8acd343cf5..85efe2724e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -50,6 +50,7 @@ #include "llcallbacklist.h" #include "llparcel.h" #include "llaudioengine.h" // for gAudiop +#include "llurldispatcher.h" #include "llvoavatar.h" #include "llvoavatarself.h" #include "llviewerregion.h" @@ -1090,7 +1091,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mBackgroundColor(LLColor4::white), mNavigateSuspended(false), mNavigateSuspendedDeferred(false), - mIsUpdated(false) + mIsUpdated(false), + mTrustedBrowser(false) { // Set up the mute list observer if it hasn't been set up already. @@ -2353,6 +2355,14 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { switch(event) { + case MEDIA_EVENT_CLICK_LINK_NOFOLLOW: + { + LL_DEBUGS("Media") << "MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is: " << plugin->getClickURL() << LL_ENDL; + std::string url = plugin->getClickURL(); + LLURLDispatcher::dispatch(url, NULL, mTrustedBrowser); + + } + break; case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH: { // The plugin failed to load properly. Make sure the timer doesn't retry. diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 9dbffa78b3..bc51e713a1 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -322,6 +322,9 @@ public: void setLowPrioritySizeLimit(int size); void setTextureID(LLUUID id = LLUUID::null); + + bool isTrustedBrowser() { return mTrustedBrowser; } + void setTrustedBrowser(bool trusted) { mTrustedBrowser = trusted; } typedef enum { @@ -405,6 +408,7 @@ private: LLColor4 mBackgroundColor; bool mNavigateSuspended; bool mNavigateSuspendedDeferred; + bool mTrustedBrowser; private: BOOL mIsUpdated ; |