summaryrefslogtreecommitdiff
path: root/indra/media_plugins/cef
diff options
context:
space:
mode:
authorcallum_linden <none@none>2015-12-15 15:24:41 -0800
committercallum_linden <none@none>2015-12-15 15:24:41 -0800
commit3bf8929d932a6253177be55766cd2a80bb6e224d (patch)
tree316d7c3231e370ed7a786cc23f3a6a9709110ce3 /indra/media_plugins/cef
parent3e46058651570f8e3a8cd20b597544bb07fea0a9 (diff)
MAINT-5966 - file download failures need feedback
Diffstat (limited to 'indra/media_plugins/cef')
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index 19df1fa640..a2479cc946 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -68,6 +68,7 @@ private:
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 onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle);
+ void onFileDownloadCallback(std::string filename);
void postDebugMessage(const std::string& msg);
void authResponse(LLPluginMessage &message);
@@ -292,6 +293,18 @@ bool MediaPluginCEF::onHTTPAuthCallback(const std::string host, const std::strin
return mAuthOK;
}
+////////////////////////////////////////////////////////////////////////////////
+//
+void MediaPluginCEF::onFileDownloadCallback(const std::string filename)
+{
+ mAuthOK = false;
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "file_download");
+ message.setValue("filename", filename);
+
+ sendMessage(message);
+}
+
void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle)
{
std::string name = "";
@@ -425,6 +438,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mLLCEFLib->setOnAddressChangeCallback(boost::bind(&MediaPluginCEF::onAddressChangeCallback, this, _1));
mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2));
mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4));
+ mLLCEFLib->setOnFileDownloadCallback(boost::bind(&MediaPluginCEF::onFileDownloadCallback, this, _1));
mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2));
mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this));