summaryrefslogtreecommitdiff
path: root/indra/media_plugins/webkit
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2010-03-18 16:53:27 -0700
committerCallum Prentice <callum@lindenlab.com>2010-03-18 16:53:27 -0700
commitcb7fbc8a2093fd1ed5440d0f3184d9080cecad48 (patch)
treec2c5c95acb4224d12b0a95aa5f52778a31fc4402 /indra/media_plugins/webkit
parentfabae99883ff724f0f46336cf787d99997ec9f33 (diff)
EXT-6466 "Move "Enable Cookies" checkbox...", EXT-6402 "Add feature to disable Web plugins via prefs" and EXT-6401 "Add feature to disable Javascript via prefs"
Apologies for the multiple commit of Jiras - these changes are closely related and impossible to commit deparately Reviewed by Monroe
Diffstat (limited to 'indra/media_plugins/webkit')
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp50
1 files changed, 36 insertions, 14 deletions
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 24c53638d2..0462fce236 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -89,6 +89,9 @@ private:
std::string mProfileDir;
std::string mHostLanguage;
+ bool mCookiesEnabled;
+ bool mJavascriptEnabled;
+ bool mPluginsEnabled;
enum
{
@@ -277,21 +280,18 @@ private:
{
LLQtWebKit::getInstance()->setHostLanguage(mHostLanguage);
}
+
+ // turn on/off cookies based on what host app tells us
+ LLQtWebKit::getInstance()->enableCookies( mCookiesEnabled );
+
+ // turn on/off plugins based on what host app tells us
+ LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled );
+
+ // turn on/off Javascript based on what host app tells us
+ LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled );
// create single browser window
mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight );
-#if LL_WINDOWS
- // Enable plugins
- LLQtWebKit::getInstance()->enablePlugins(true);
-#elif LL_DARWIN
- // Enable plugins
- LLQtWebKit::getInstance()->enablePlugins(true);
-#elif LL_LINUX
- // Enable plugins
- LLQtWebKit::getInstance()->enablePlugins(true);
-#endif
- // Enable cookies
- LLQtWebKit::getInstance()->enableCookies( true );
// tell LLQtWebKit about the size of the browser window
LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight );
@@ -671,6 +671,10 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_
mBackgroundR = 0.0f;
mBackgroundG = 0.0f;
mBackgroundB = 0.0f;
+
+ mHostLanguage = "en"; // default to english
+ mJavascriptEnabled = true; // default to on
+ mPluginsEnabled = true; // default to on
}
MediaPluginWebKit::~MediaPluginWebKit()
@@ -825,6 +829,14 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
// FIXME: Should we do anything with this if it comes in after the browser has been initialized?
}
+ else if(message_name == "plugins_enabled")
+ {
+ mPluginsEnabled = message_in.getValueBoolean("enable");
+ }
+ else if(message_name == "javascript_enabled")
+ {
+ mJavascriptEnabled = message_in.getValueBoolean("enable");
+ }
else if(message_name == "size_change")
{
std::string name = message_in.getValue("name");
@@ -1026,8 +1038,18 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
}
else if(message_name == "enable_cookies")
{
- bool val = message_in.getValueBoolean("enable");
- LLQtWebKit::getInstance()->enableCookies( val );
+ mCookiesEnabled = message_in.getValueBoolean("enable");
+ LLQtWebKit::getInstance()->enableCookies( mCookiesEnabled );
+ }
+ else if(message_name == "enable_plugins")
+ {
+ mPluginsEnabled = message_in.getValueBoolean("enable");
+ LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled );
+ }
+ else if(message_name == "enable_javascript")
+ {
+ mJavascriptEnabled = message_in.getValueBoolean("enable");
+ //LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled );
}
else if(message_name == "proxy_setup")
{