summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2021-08-20 08:28:48 -0700
committerCallum Prentice <callum@lindenlab.com>2021-08-20 08:28:48 -0700
commit0c89e67eb5bf2d82596d0c697831787cbbdf1e7f (patch)
tree070cc3da58f67f9935f66dbadae3c283af0ac401 /indra/newview/llviewermedia.cpp
parentc40b8310b00f1d620a2f5a94f2514c8bf3531373 (diff)
DRTVWR-534: Batch of modifications to 360 capture project after moving from internal repo to public one.
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index d35dbda907..c428e73a6e 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1746,8 +1746,16 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
media_source->cookies_enabled( cookies_enabled || clean_browser);
// collect 'javascript enabled' setting from prefs and send to embedded browser
- bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" );
- media_source->setJavascriptEnabled( javascript_enabled || clean_browser);
+ bool javascript_enabled = gSavedSettings.getBOOL("BrowserJavascriptEnabled");
+ media_source->setJavascriptEnabled(javascript_enabled || clean_browser);
+
+ // collect 'web security disabled' (see Chrome --web-security-disabled) setting from prefs and send to embedded browser
+ bool web_security_disabled = gSavedSettings.getBOOL("BrowserWebSecurityDisabled");
+ media_source->setWebSecurityDisabled(web_security_disabled || clean_browser);
+
+ // collect setting indicates if local file access from file URLs is allowed from prefs and send to embedded browser
+ bool file_access_from_file_urls = gSavedSettings.getBOOL("BrowserFileAccessFromFileUrls");
+ media_source->setFileAccessFromFileUrlsEnabled(file_access_from_file_urls || clean_browser);
// As of SL-15559 PDF files do not load in CEF v91 we enable plugins
// but explicitly disable Flash (PDF support in CEF is now treated as a plugin)
@@ -1908,6 +1916,15 @@ void LLViewerMediaImpl::loadURI()
}
//////////////////////////////////////////////////////////////////////////////////////////
+void LLViewerMediaImpl::executeJavaScript(const std::string& code)
+{
+ if (mMediaSource)
+ {
+ mMediaSource->executeJavaScript(code);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::setSize(int width, int height)
{
mMediaWidth = width;
@@ -3212,8 +3229,19 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
case LLViewerMediaObserver::MEDIA_EVENT_FILE_DOWNLOAD:
{
- //llinfos << "Media event - file download requested - filename is " << self->getFileDownloadFilename() << llendl;
- LLNotificationsUtil::add("MediaFileDownloadUnsupported");
+ LL_DEBUGS("Media") << "Media event - file download requested - filename is " << plugin->getFileDownloadFilename() << LL_ENDL;
+ // pick a file from SAVE FILE dialog
+
+ // need a better algorithm that this or else, pass in type of save type
+ // from event that initiated it - this is okay for now - only thing
+ // that saves is 360s
+ std::string suggested_filename = plugin->getFileDownloadFilename();
+ LLFilePicker::ESaveFilter filter = LLFilePicker::FFSAVE_ALL;
+ if (suggested_filename.find(".jpg") != std::string::npos || suggested_filename.find(".jpeg") != std::string::npos)
+ filter = LLFilePicker::FFSAVE_JPEG;
+ if (suggested_filename.find(".png") != std::string::npos)
+ filter = LLFilePicker::FFSAVE_PNG;
+ init_threaded_picker_save_dialog(plugin, filter, suggested_filename);
}
break;