diff options
Diffstat (limited to 'indra/media_plugins/cef')
-rw-r--r-- | indra/media_plugins/cef/CMakeLists.txt | 11 | ||||
-rw-r--r-- | indra/media_plugins/cef/media_plugin_cef.cpp | 22 |
2 files changed, 27 insertions, 6 deletions
diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 388030c979..db471c7906 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -2,6 +2,7 @@ project(media_plugin_cef) +include(Boost) include(00-Common) include(LLCommon) include(LLImage) @@ -52,8 +53,8 @@ set(media_plugin_cef_HEADER_FILES set (media_plugin_cef_LINK_LIBRARIES ${LLPLUGIN_LIBRARIES} ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} ${CEF_PLUGIN_LIBRARIES} + ${LLCOMMON_LIBRARIES} ${PLUGIN_API_WINDOWS_LIBRARIES}) @@ -84,11 +85,9 @@ add_library(media_plugin_cef ${media_plugin_cef_SOURCE_FILES} ) -add_dependencies(media_plugin_cef - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} -) +#add_dependencies(media_plugin_cef +# ${MEDIA_PLUGIN_BASE_LIBRARIES} +#) target_link_libraries(media_plugin_cef ${media_plugin_cef_LINK_LIBRARIES} diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 9028f73e30..8d9d1dd975 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -69,6 +69,7 @@ private: 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); + const std::string onFileDialogCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -95,6 +96,7 @@ private: bool mCanPaste; std::string mCachePath; std::string mCookiePath; + std::string mPickedFile; LLCEFLib* mLLCEFLib; VolumeCatcher mVolumeCatcher; @@ -123,6 +125,7 @@ MediaPluginBase(host_send_func, host_user_data) mCanPaste = false; mCachePath = ""; mCookiePath = ""; + mPickedFile = ""; mLLCEFLib = new LLCEFLib(); } @@ -305,6 +308,20 @@ void MediaPluginCEF::onFileDownloadCallback(const std::string filename) sendMessage(message); } +//////////////////////////////////////////////////////////////////////////////// +// +const std::string MediaPluginCEF::onFileDialogCallback() +{ + mPickedFile.clear(); + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); + message.setValueBoolean("blocking_request", true); + + sendMessage(message); + + return mPickedFile; +} + void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle) { std::string name = ""; @@ -439,6 +456,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) 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->setOnFileDialogCallback(boost::bind(&MediaPluginCEF::onFileDialogCallback, this)); mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); @@ -648,6 +666,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean("enable"); } + if (message_name == "pick_file_response") + { + mPickedFile = message_in.getValue("file"); + } if (message_name == "auth_response") { authResponse(message_in); |