summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorcallum_linden <none@none>2015-09-03 18:16:46 -0700
committercallum_linden <none@none>2015-09-03 18:16:46 -0700
commit236b3b9f842c86e1f176068ab70b82f83874e2ab (patch)
tree5e8eaf70636b751e7a1c4e2e064ba07724e083fb /indra
parent33da4d9d5dd05bbc9dc232525b59017f7ecbbcdd (diff)
support for external links and location_changed messages
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llplugin/llpluginclassmedia.cpp2
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp37
-rwxr-xr-xindra/newview/llmediactrl.cpp30
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_login.xml2
4 files changed, 39 insertions, 32 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index f0c547c8d1..5e0902c84d 100755
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -1121,7 +1121,7 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
{
mClickURL = message.getValue("uri");
mClickTarget = message.getValue("target");
- mClickUUID = message.getValue("uuid");
+ //mClickUUID = message.getValue("uuid");
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF);
}
else if(message_name == "click_nofollow")
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index f51a2715bb..97364d949a 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -63,8 +63,8 @@ private:
void onTitleChangeCallback(std::string title);
void onLoadStartCallback();
void onLoadEndCallback(int httpStatusCode);
- void onNavigateURLCallback(std::string url);
- void onExternalTargetLinkCallback(std::string url);
+ void onAddressChangeCallback(std::string url);
+ void onNavigateURLCallback(std::string url, std::string target);
bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password);
void postDebugMessage(const std::string& msg);
@@ -159,16 +159,6 @@ void MediaPluginCEF::onPageChangedCallback(unsigned char* pixels, int width, int
////////////////////////////////////////////////////////////////////////////////
//
-void MediaPluginCEF::onCustomSchemeURLCallback(std::string url)
-{
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow");
- message.setValue("uri", url);
- message.setValue("nav_type", "clicked"); // TODO: differentiate between click and navigate to
- sendMessage(message);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
void MediaPluginCEF::onConsoleMessageCallback(std::string message, std::string source, int line)
{
std::stringstream str;
@@ -219,7 +209,7 @@ void MediaPluginCEF::onLoadEndCallback(int httpStatusCode)
////////////////////////////////////////////////////////////////////////////////
//
-void MediaPluginCEF::onNavigateURLCallback(std::string url)
+void MediaPluginCEF::onAddressChangeCallback(std::string url)
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed");
message.setValue("uri", url);
@@ -227,10 +217,24 @@ void MediaPluginCEF::onNavigateURLCallback(std::string url)
}
////////////////////////////////////////////////////////////////////////////////
-// triggered when user clicks link with "external" attribute
-void MediaPluginCEF::onExternalTargetLinkCallback(std::string url)
+//
+void MediaPluginCEF::onNavigateURLCallback(std::string url, std::string target)
{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href");
+ message.setValue("uri", url);
+ message.setValue("target", target);
+ message.setValue("uuid", ""); // not used right now
+ sendMessage(message);
+}
+////////////////////////////////////////////////////////////////////////////////
+//
+void MediaPluginCEF::onCustomSchemeURLCallback(std::string url)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow");
+ message.setValue("uri", url);
+ message.setValue("nav_type", "clicked"); // TODO: differentiate between click and navigate to
+ sendMessage(message);
}
////////////////////////////////////////////////////////////////////////////////
@@ -354,9 +358,8 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mLLCEFLib->setOnTitleChangeCallback(boost::bind(&MediaPluginCEF::onTitleChangeCallback, this, _1));
mLLCEFLib->setOnLoadStartCallback(boost::bind(&MediaPluginCEF::onLoadStartCallback, this));
mLLCEFLib->setOnLoadEndCallback(boost::bind(&MediaPluginCEF::onLoadEndCallback, this, _1));
- mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1));
+ mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2));
mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4));
- mLLCEFLib->setOnExternalTargetLinkCallback(boost::bind(&MediaPluginCEF::onExternalTargetLinkCallback, this, _1));
LLCEFLibSettings settings;
settings.inital_width = 1024;
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index d1bb799015..40d352f9b7 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -993,19 +993,23 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
std::string target = self->getClickTarget();
std::string uuid = self->getClickUUID();
- LLNotification::Params notify_params;
- notify_params.name = "PopupAttempt";
- notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", mMediaTextureID);
- notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2);
-
- if (mTrusted)
- {
- LLNotifications::instance().forceResponse(notify_params, 0);
- }
- else
- {
- LLNotifications::instance().add(notify_params);
- }
+ LLWeb::loadURL(url, target, std::string());
+
+ // CP: removing this code because we no longer support popups so this breaks the flow.
+ // replaced with a bare call to LLWeb::LoadURL(...)
+ //LLNotification::Params notify_params;
+ //notify_params.name = "PopupAttempt";
+ //notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", mMediaTextureID);
+ //notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2);
+
+ //if (mTrusted)
+ //{
+ // LLNotifications::instance().forceResponse(notify_params, 0);
+ //}
+ //else
+ //{
+ // LLNotifications::instance().add(notify_params);
+ //}
break;
};
diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml
index e91eea04d1..f59c5e35a6 100755
--- a/indra/newview/skins/default/xui/en/menu_login.xml
+++ b/indra/newview/skins/default/xui/en/menu_login.xml
@@ -230,7 +230,7 @@
name="Web Content Floater Debug Test">
<menu_item_call.on_click
function="Advanced.WebContentTest"
- parameter="http://google.com"/>
+ parameter="https://callum-linden.s3.amazonaws.com/ceftests.html"/>
</menu_item_call>
<menu
create_jump_keys="true"