From 8e3acf461e3f3536b621a533d6ab15bc9e0a36be Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Jul 2015 16:14:42 -0700 Subject: Changes to implement enable/disable cookies, javascript, plugins --- indra/media_plugins/cef/media_plugin_cef.cpp | 34 +++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'indra/media_plugins/cef') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 70a8eb5d9b..4bde7e7d49 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -74,6 +74,9 @@ private: bool mEnableMediaPluginDebugging; std::string mHostLanguage; + bool mCookiesEnabled; + bool mPluginsEnabled; + bool mJavascriptEnabled; LLCEFLib* mLLCEFLib; }; @@ -88,7 +91,9 @@ MediaPluginBase(host_send_func, host_user_data) mPixels = 0; mEnableMediaPluginDebugging = true; mHostLanguage = "en"; - + mCookiesEnabled = true; + mPluginsEnabled = false; + mJavascriptEnabled = true; mLLCEFLib = new LLCEFLib(); } @@ -286,14 +291,14 @@ void MediaPluginCEF::receiveMessage(const char* message_string) LLCEFLibSettings settings; settings.inital_width = 1024; settings.inital_height = 1024; - settings.javascript_enabled = true; - settings.cookies_enabled = true; + settings.plugins_enabled = mPluginsEnabled; + settings.javascript_enabled = mJavascriptEnabled; + settings.cookies_enabled = mCookiesEnabled; settings.accept_language_list = mHostLanguage; bool result = mLLCEFLib->init(settings); if (!result) { - // TODO - return something to indicate failure - //MessageBoxA(0, "FAIL INIT", 0, 0); + // if this fails, the media system in viewer will put up a message } // Plugin gets to decide the texture parameters to use. @@ -423,7 +428,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } #elif LL_WINDOWS - std::string event = message_in.getValue("event"); S32 key = message_in.getValueS32("key"); std::string modifiers = message_in.getValue("modifiers"); @@ -441,9 +445,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } keyEvent(key_event, key, decodeModifiers(modifiers), native_key_data); - #endif - } else if (message_name == "enable_media_plugin_debugging") { @@ -474,6 +476,22 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mLLCEFLib->goBack(); } + else if (message_name == "cookies_enabled") + { + mCookiesEnabled = message_in.getValueBoolean("enable"); +std::stringstream str; +str << "@@@@@@@##### cookies_enabled - mCookiesEnabled = " << mCookiesEnabled; +postDebugMessage(str.str()); + + } + else if (message_name == "plugins_enabled") + { + mPluginsEnabled = message_in.getValueBoolean("enable"); + } + else if (message_name == "javascript_enabled") + { + mJavascriptEnabled = message_in.getValueBoolean("enable"); + } } else { -- cgit v1.2.3