diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-09-10 16:43:35 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-09-10 16:43:35 -0700 |
commit | 24f308caaeda941a626b6143d95adbfe07450f97 (patch) | |
tree | 848fee057e9df5a1198dd3120ecf0fe920e713f9 /indra/llplugin | |
parent | f6645b10dd391218edff67579a4388dc8bbac7d2 (diff) |
Added support for a media plugin message that asks the viewer to open a file picker on the plugin's behalf.
Reviewed by Callum.
Diffstat (limited to 'indra/llplugin')
-rw-r--r-- | indra/llplugin/llpluginclassmedia.cpp | 12 | ||||
-rw-r--r-- | indra/llplugin/llpluginclassmedia.h | 4 | ||||
-rw-r--r-- | indra/llplugin/llpluginclassmediaowner.h | 1 |
3 files changed, 16 insertions, 1 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 4f45f95e85..06ed632da8 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -669,6 +669,18 @@ F64 LLPluginClassMedia::getCPUUsage() return result; } +void LLPluginClassMedia::sendPickFileResponse(const std::string &file) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response"); + message.setValue("file", file); + if(mPlugin->isBlocked()) + { + // If the plugin sent a blocking pick-file request, the response should unblock it. + message.setValueBoolean("blocking_response", true); + } + sendMessage(message); +} + void LLPluginClassMedia::cut() { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut"); diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index ee53f3a4da..eaafbfe389 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -156,6 +156,8 @@ public: void setLowPrioritySizeLimit(int size); F64 getCPUUsage(); + + void sendPickFileResponse(const std::string &file); // Valid after a MEDIA_EVENT_CURSOR_CHANGED event std::string getCursorName() const { return mCursorName; }; @@ -176,7 +178,7 @@ public: void setLanguageCode(const std::string &language_code); void setPluginsEnabled(const bool enabled); void setJavascriptEnabled(const bool enabled); - + /////////////////////////////////// // media browser class functions bool pluginSupportsMediaBrowser(void); diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h index 8a19e7530e..e60c85737f 100644 --- a/indra/llplugin/llpluginclassmediaowner.h +++ b/indra/llplugin/llpluginclassmediaowner.h @@ -55,6 +55,7 @@ public: MEDIA_EVENT_CLICK_LINK_HREF, // I'm not entirely sure what the semantics of these two are MEDIA_EVENT_CLICK_LINK_NOFOLLOW, MEDIA_EVENT_CLOSE_REQUEST, // The plugin requested its window be closed (currently hooked up to javascript window.close in webkit) + MEDIA_EVENT_PICK_FILE_REQUEST, // The plugin wants the user to pick a file MEDIA_EVENT_PLUGIN_FAILED_LAUNCH, // The plugin failed to launch MEDIA_EVENT_PLUGIN_FAILED // The plugin died unexpectedly |