summaryrefslogtreecommitdiff
path: root/indra/newview/llmediactrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r--indra/newview/llmediactrl.cpp39
1 files changed, 29 insertions, 10 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index a2c809884b..982d82ca01 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -667,6 +667,15 @@ void LLMediaCtrl::setHomePageUrl( const std::string& urlIn, const std::string& m
}
}
+void LLMediaCtrl::setTarget(const std::string& target)
+{
+ mTarget = target;
+ if (mMediaSource)
+ {
+ mMediaSource->setTarget(mTarget);
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
//
bool LLMediaCtrl::setCaretColor(unsigned int red, unsigned int green, unsigned int blue)
@@ -708,6 +717,7 @@ bool LLMediaCtrl::ensureMediaSourceExists()
{
mMediaSource->setUsedInUI(true);
mMediaSource->setHomeURL(mHomePageUrl, mHomePageMimeType);
+ mMediaSource->setTarget(mTarget);
mMediaSource->setVisible( getVisible() );
mMediaSource->addObserver( this );
mMediaSource->setBackgroundColor( getBackgroundColor() );
@@ -927,7 +937,7 @@ void LLMediaCtrl::draw()
}
}
-
+
LLPanel::draw();
// Restore the previous values
@@ -1030,17 +1040,14 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
// retrieve the event parameters
std::string url = self->getClickURL();
std::string target = self->getClickTarget();
- U32 target_type = self->getClickTargetType();
+ std::string uuid = self->getClickUUID();
- switch (target_type)
+ if(gSavedSettings.getBOOL("MediaEnablePopups"))
{
- case LLPluginClassMedia::TARGET_NONE:
- // ignore this click and let media plugin handle it
- break;
- default:
- LLNotificationPtr popup_notify = LLNotifications::instance().add("PopupAttempt",
+
+ LLNotificationPtr popup_notify = LLNotificationsUtil::add("PopupAttempt",
LLSD(),
- LLSD().with("target", target).with("url", url),
+ LLSD().with("source", mMediaID).with("target", target).with("url", url).with("uuid", uuid),
boost::bind(&LLMediaCtrl::onPopup, this, _1, _2));
showNotification(popup_notify);
break;
@@ -1082,6 +1089,12 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PICK_FILE_REQUEST" << LL_ENDL;
}
break;
+
+ case MEDIA_EVENT_GEOMETRY_CHANGE:
+ {
+ LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_GEOMETRY_CHANGE, uuid is " << self->getClickUUID() << LL_ENDL;
+ }
+ break;
};
// chain all events to any potential observers of this object.
@@ -1099,8 +1112,14 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response)
{
if (response["open"])
{
- LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"]);
+ LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]);
}
+ else
+ {
+ // Make sure the opening instance knows its window open request was denied, so it can clean things up.
+ LLViewerMedia::proxyWindowClosed(notification["payload"]["uuid"]);
+ }
+
}
void LLMediaCtrl::onCloseNotification()