summaryrefslogtreecommitdiff
path: root/indra/media_plugins/webkit/media_plugin_webkit.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-11-16 17:01:44 -0800
committerMonroe Linden <monroe@lindenlab.com>2010-11-16 17:01:44 -0800
commitdf8b87435f7443caed5779ef36875004bcfab425 (patch)
tree69bd65b8ddf8abe39daa1da8379d3cd2ff76aff4 /indra/media_plugins/webkit/media_plugin_webkit.cpp
parent5397edebbccd2df41db51804c4e2fa529ac96132 (diff)
SOCIAL-266 WIP HTTP AUTH dialogs no longer work in LLQtWebKit 4.7.1
Added support to the webkit media plugin and llpluginclassmedia for passing through the auth request/response. We still need an updated build of llqtwebkit for all platforms, as well as some UI work in the viewer to actually display the auth dialog.
Diffstat (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp')
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 15c107cbe1..5dbc2f9fdf 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -569,6 +569,43 @@ private:
return blockingPickFile();
}
+ std::string mAuthUsername;
+ std::string mAuthPassword;
+ bool mAuthOK;
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // virtual
+ bool onAuthRequest(const std::string &in_url, const std::string &in_realm, std::string &out_username, std::string &out_password)
+ {
+ mAuthOK = false;
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_request");
+ message.setValue("url", in_url);
+ message.setValue("realm", in_realm);
+ message.setValueBoolean("blocking_request", true);
+
+ // The "blocking_request" key in the message means this sendMessage call will block until a response is received.
+ sendMessage(message);
+
+ if(mAuthOK)
+ {
+ out_username = mAuthUsername;
+ out_password = mAuthPassword;
+ }
+
+ return mAuthOK;
+ }
+
+ void authResponse(LLPluginMessage &message)
+ {
+ mAuthOK = message.getValueBoolean("ok");
+ if(mAuthOK)
+ {
+ mAuthUsername = message.getValue("username");
+ mAuthPassword = message.getValue("password");
+ }
+ }
+
LLQtWebKit::EKeyboardModifier decodeModifiers(std::string &modifiers)
{
int result = 0;
@@ -1096,6 +1133,10 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
{
onPickFileResponse(message_in.getValue("file"));
}
+ if(message_name == "auth_response")
+ {
+ authResponse(message_in);
+ }
else
{
// std::cerr << "MediaPluginWebKit::receiveMessage: unknown media message: " << message_string << std::endl;