Include support for http auth. also improve mouse handling with drag select

meow-7.2.2
callum_linden 2015-07-24 23:54:09 +01:00
parent a016f92b29
commit 7cc5db9fdb
2 changed files with 52 additions and 6 deletions

View File

@ -1536,11 +1536,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>57d4b1a1066573bff5f9ef7e11e4157e</string>
<string>5a4a0ed7fa23e19e9b7513a29668d226</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303693/arch/Darwin/installer/llceflib-1.0.1.303693-darwin-303693.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303823/arch/Darwin/installer/llceflib-1.0.1.303823-darwin-303823.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -1550,18 +1550,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>09b802c5bb6230958e2e7c7a8523f8ac</string>
<string>1327780d088ce50447f82aecdc5bbb4d</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303693/arch/CYGWIN/installer/llceflib-1.0.1.303693-windows-303693.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303823/arch/CYGWIN/installer/llceflib-1.0.1.303823-windows-303823.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
</map>
</map>
<key>version</key>
<string>1.0.1.303693</string>
<string>1.0.1.303823</string>
</map>
<key>llphysicsextensions_source</key>
<map>

View File

@ -52,6 +52,7 @@ public:
/*virtual*/
void receiveMessage(const char* message_string);
private:
bool init();
@ -63,9 +64,10 @@ private:
void onLoadStartCallback();
void onLoadEndCallback(int httpStatusCode);
void onNavigateURLCallback(std::string url);
bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password);
void postDebugMessage(const std::string& msg);
void authResponse(LLPluginMessage &message);
EKeyboardModifier decodeModifiers(std::string &modifiers);
void deserializeKeyboardData(LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers);
@ -77,6 +79,9 @@ private:
bool mCookiesEnabled;
bool mPluginsEnabled;
bool mJavascriptEnabled;
std::string mAuthUsername;
std::string mAuthPassword;
bool mAuthOK;
LLCEFLib* mLLCEFLib;
};
@ -94,6 +99,9 @@ MediaPluginBase(host_send_func, host_user_data)
mCookiesEnabled = true;
mPluginsEnabled = false;
mJavascriptEnabled = true;
mAuthUsername = "";
mAuthPassword = "";
mAuthOK = false;
mLLCEFLib = new LLCEFLib();
}
@ -203,6 +211,39 @@ void MediaPluginCEF::onNavigateURLCallback(std::string url)
sendMessage(message);
}
////////////////////////////////////////////////////////////////////////////////
//
bool MediaPluginCEF::onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password)
{
mAuthOK = false;
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_request");
message.setValue("url", host);
message.setValue("realm", 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)
{
username = mAuthUsername;
password = mAuthPassword;
}
return mAuthOK;
}
void MediaPluginCEF::authResponse(LLPluginMessage &message)
{
mAuthOK = message.getValueBoolean("ok");
if (mAuthOK)
{
mAuthUsername = message.getValue("username");
mAuthPassword = message.getValue("password");
}
}
////////////////////////////////////////////////////////////////////////////////
//
void MediaPluginCEF::receiveMessage(const char* message_string)
@ -287,6 +328,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mLLCEFLib->setOnLoadStartCallback(boost::bind(&MediaPluginCEF::onLoadStartCallback, this));
mLLCEFLib->setOnLoadEndCallback(boost::bind(&MediaPluginCEF::onLoadEndCallback, this, _1));
mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1));
mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4));
LLCEFLibSettings settings;
settings.inital_width = 1024;
@ -451,6 +493,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
{
mEnableMediaPluginDebugging = message_in.getValueBoolean("enable");
}
if (message_name == "auth_response")
{
authResponse(message_in);
}
}
else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER)
{