summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorcallum_linden <none@none>2015-07-17 16:14:42 -0700
committercallum_linden <none@none>2015-07-17 16:14:42 -0700
commit8e3acf461e3f3536b621a533d6ab15bc9e0a36be (patch)
tree89cee4d8232be95b5e5af52c822315a9ef7d66bc /indra
parent0d6d281cb3c54b08eb845199ba24992bddcf9bae (diff)
Changes to implement enable/disable cookies, javascript, plugins
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llplugin/llpluginclassmedia.cpp6
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp34
2 files changed, 29 insertions, 11 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index 52626b0302..f0c547c8d1 100755
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -828,14 +828,14 @@ void LLPluginClassMedia::setLanguageCode(const std::string &language_code)
void LLPluginClassMedia::setPluginsEnabled(const bool enabled)
{
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "plugins_enabled");
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "plugins_enabled");
message.setValueBoolean("enable", enabled);
sendMessage(message);
}
void LLPluginClassMedia::setJavascriptEnabled(const bool enabled)
{
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "javascript_enabled");
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "javascript_enabled");
message.setValueBoolean("enable", enabled);
sendMessage(message);
}
@@ -1266,7 +1266,7 @@ void LLPluginClassMedia::set_cookies(const std::string &cookies)
void LLPluginClassMedia::enable_cookies(bool enable)
{
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "enable_cookies");
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "cookies_enabled");
message.setValueBoolean("enable", enable);
sendMessage(message);
}
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
{