summaryrefslogtreecommitdiff
path: root/indra/newview/llweb.cpp
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2010-05-31 19:03:23 +0300
committerYuri Chebotarev <ychebotarev@productengine.com>2010-05-31 19:03:23 +0300
commit3517393b4c9949e62e1eca866e449e463e7a090e (patch)
treeffa886f3c83de5c830155c0a11216e605665dcb5 /indra/newview/llweb.cpp
parent95fad9ce8633ea26b7fb7ca2badbf20e68dd8f9d (diff)
parent40b476dbb2aee494d57dce81427b74ac19b1428d (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llweb.cpp')
-rw-r--r--indra/newview/llweb.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index aa03b1afd1..5c9633c036 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -54,6 +54,10 @@
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "llviewerwindow.h"
+#include "llnotificationsutil.h"
+
+bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async );
+
class URLLoader : public LLToastAlertPanel::URLLoader
{
@@ -110,11 +114,26 @@ void LLWeb::loadURLExternal(const std::string& url)
// static
void LLWeb::loadURLExternal(const std::string& url, bool async)
{
- std::string escaped_url = escapeURL(url);
- if (gViewerWindow)
+ LLSD payload;
+ payload["url"] = url;
+ LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, boost::bind(on_load_url_external_response, _1, _2, async));
+}
+
+// static
+bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async )
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if ( 0 == option )
{
- gViewerWindow->getWindow()->spawnWebBrowser(escaped_url, async);
+ LLSD payload = notification["payload"];
+ std::string url = payload["url"].asString();
+ std::string escaped_url = LLWeb::escapeURL(url);
+ if (gViewerWindow)
+ {
+ gViewerWindow->getWindow()->spawnWebBrowser(escaped_url, async);
+ }
}
+ return false;
}