summaryrefslogtreecommitdiff
path: root/indra/media_plugins/cef/media_plugin_cef.cpp
diff options
context:
space:
mode:
authorcallum_linden <none@none>2015-07-02 09:39:41 -0700
committercallum_linden <none@none>2015-07-02 09:39:41 -0700
commitd89b4109f9ac3f1ef95480823df292bbc8200347 (patch)
tree3d49dbf960aed3c6416eda8f01ccda132be1f6c9 /indra/media_plugins/cef/media_plugin_cef.cpp
parentf7908a50294adff3456436074075a677a9c6239b (diff)
2015 and we still care about line endings.. sigh
Diffstat (limited to 'indra/media_plugins/cef/media_plugin_cef.cpp')
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp100
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;
}
+