diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/media_plugins/cef/media_plugin_cef.cpp | 100 |
1 files changed, 53 insertions, 47 deletions
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 3b82071ae8..358b35bbe2 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -53,15 +53,15 @@ public: private: bool init(); - void pageChangedCallback(unsigned char* pixels, int width, int height);
- void onCustomSchemeURLCallback(std::string url);
- void onConsoleMessageCallback(std::string message, std::string source, int line);
- void onStatusMessageCallback(std::string value);
- void onTitleChangeCallback(std::string title);
- void onLoadStartCallback();
- void onLoadEndCallback(int httpStatusCode);
- void onNavigateURLCallback(std::string url);
-
+ void pageChangedCallback(unsigned char* pixels, int width, int height); + void onCustomSchemeURLCallback(std::string url); + void onConsoleMessageCallback(std::string message, std::string source, int line); + void onStatusMessageCallback(std::string value); + void onTitleChangeCallback(std::string title); + void onLoadStartCallback(); + void onLoadEndCallback(int httpStatusCode); + void onNavigateURLCallback(std::string url); + void postDebugMessage(const std::string& msg); bool mEnableMediaPluginDebugging; @@ -123,10 +123,10 @@ void MediaPluginCEF::pageChangedCallback(unsigned char* pixels, int width, int h // 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);
+ 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); } //////////////////////////////////////////////////////////////////////////////// @@ -142,8 +142,8 @@ void MediaPluginCEF::onConsoleMessageCallback(std::string message, std::string s // void MediaPluginCEF::onStatusMessageCallback(std::string value) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "status_text");
- message.setValue("status", value);
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "status_text"); + message.setValue("status", value); sendMessage(message); } @@ -151,19 +151,19 @@ void MediaPluginCEF::onStatusMessageCallback(std::string value) // void MediaPluginCEF::onTitleChangeCallback(std::string title) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text");
- message.setValue("name", title);
- sendMessage(message);
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text"); + message.setValue("name", title); + sendMessage(message); } //////////////////////////////////////////////////////////////////////////////// // void MediaPluginCEF::onLoadStartCallback() { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin");
- //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed?
- message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack());
- message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward());
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); + //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed? + message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack()); + message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward()); sendMessage(message); } @@ -171,11 +171,11 @@ void MediaPluginCEF::onLoadStartCallback() // void MediaPluginCEF::onLoadEndCallback(int httpStatusCode) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete");
- //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed?
- message.setValueS32("result_code", httpStatusCode);
- message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack());
- message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward());
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); + //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed? + message.setValueS32("result_code", httpStatusCode); + message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack()); + message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward()); sendMessage(message); } @@ -183,9 +183,9 @@ void MediaPluginCEF::onLoadEndCallback(int httpStatusCode) // void MediaPluginCEF::onNavigateURLCallback(std::string url) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed");
- message.setValue("uri", url);
- sendMessage(message);
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed"); + message.setValue("uri", url); + sendMessage(message); } //////////////////////////////////////////////////////////////////////////////// @@ -419,23 +419,28 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) { - if (message_name == "browse_stop")
- {
- mLLCEFLib->stop();
- }
- else if (message_name == "browse_reload")
- {
- bool ignore_cache = true;
- mLLCEFLib->reload(ignore_cache);
- }
- else if (message_name == "browse_forward")
- {
- mLLCEFLib->goForward();
- }
- else if (message_name == "browse_back")
- {
- mLLCEFLib->goBack();
- }
+ if (message_name == "set_page_zoom_factor") + { + F32 factor = (F32)message_in.getValueReal("factor"); + mLLCEFLib->setPageZoom(factor); + } + if (message_name == "browse_stop") + { + mLLCEFLib->stop(); + } + else if (message_name == "browse_reload") + { + bool ignore_cache = true; + mLLCEFLib->reload(ignore_cache); + } + else if (message_name == "browse_forward") + { + mLLCEFLib->goForward(); + } + else if (message_name == "browse_back") + { + mLLCEFLib->goBack(); + } } else { @@ -468,3 +473,4 @@ int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, return 0; } + |